Make sure user and acars data is sent from API

This commit is contained in:
Nabeel Shahzad
2020-03-29 13:33:14 -04:00
parent 82b873c071
commit e9b30fbe30
8 changed files with 46 additions and 24 deletions

View File

@@ -416,7 +416,8 @@ class AcarsTest extends TestCase
*/
$uri = '/api/pireps/'.$pirep_id.'/update';
$this->post($uri, [
'fields' => [
'flight_time' => 60,
'fields' => [
'custom_field' => 'custom_value_changed',
],
]);
@@ -476,7 +477,23 @@ class AcarsTest extends TestCase
$body = $response->json('data');
$this->assertEquals('G26', $body['Departure Gate']);
// File the PIREP now
/*
* Get the live flights and make sure all the fields we want are there
*/
$uri = '/api/acars';
$response = $this->get($uri);
$response->assertStatus(200);
$body = $response->json('data');
$this->assertEquals($pirep->id, $body['id']);
$this->assertNotEmpty($body['user']['name']);
$this->assertNotEmpty($body['user']['avatar']);
/*
* File the PIREP
*/
$uri = '/api/pireps/'.$pirep_id.'/file';
$response = $this->post($uri, []);
$response->assertStatus(400); // missing field