Block refiling of PIREPs (#1167)
* Block refiling of PIREPs * Style fixes * Package updates
This commit is contained in:
@@ -604,8 +604,13 @@ class AcarsTest extends TestCase
|
||||
'rank_id' => $rank->id,
|
||||
]);
|
||||
|
||||
/** @var Airport $airport */
|
||||
$airport = factory(Airport::class)->create();
|
||||
|
||||
/** @var Airline $airline */
|
||||
$airline = factory(Airline::class)->create();
|
||||
|
||||
/** @var Aircraft $aircraft */
|
||||
$aircraft = $subfleet['aircraft']->random();
|
||||
|
||||
$uri = '/api/pireps/prefile';
|
||||
@@ -639,8 +644,18 @@ class AcarsTest extends TestCase
|
||||
|
||||
// Check the block_off_time and block_on_time being set
|
||||
$body = $this->get('/api/pireps/'.$pirep_id)->json('data');
|
||||
$this->assertEquals(PirepState::PENDING, $body['state']);
|
||||
$this->assertNotNull($body['block_off_time']);
|
||||
$this->assertNotNull($body['block_on_time']);
|
||||
|
||||
// Try to refile, should be blocked
|
||||
$response = $this->post($uri, [
|
||||
'flight_time' => 130,
|
||||
'fuel_used' => 8000.19,
|
||||
'distance' => 400,
|
||||
]);
|
||||
|
||||
$response->assertStatus(400);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user