Block refiling of PIREPs (#1167)

* Block refiling of PIREPs

* Style fixes

* Package updates
This commit is contained in:
Nabeel S
2021-05-03 10:00:10 -04:00
committed by GitHub
parent 5094375e13
commit fe0ef60b6c
7 changed files with 518 additions and 383 deletions

View File

@@ -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);
}
/**