Don't allow cancels from certain states (#396)

* Don't allow cancels from certain states

* Unused imports

* Don't reset the state doubly

* Move SetUserActive into listener; code cleanup

* Unused imports

* Add missing files into htaccess

* Move Command contract to correct folder
This commit is contained in:
Nabeel S
2019-09-16 13:08:26 -04:00
committed by GitHub
parent 41baefbf4a
commit aedb1f22b6
61 changed files with 231 additions and 138 deletions

View File

@@ -95,6 +95,11 @@ class PIREPTest extends TestCase
$this->get('/api/fleet/aircraft/'.$pirep->aircraft_id, [], $user)
->assertJson(['data' => ['airport_id' => $pirep->arr_airport_id]]);
// Try cancelling it
$uri = '/api/pireps/'.$pirep->id.'/cancel';
$response = $this->put($uri, [], [], $user);
$response->assertStatus(400);
/**
* Now go from ACCEPTED to REJECTED
*/