Add /pireps/id/acars/events endpoint

This commit is contained in:
Nabeel Shahzad
2018-01-30 12:06:46 -06:00
parent c8ac739820
commit ec5478a766
5 changed files with 86 additions and 9 deletions

View File

@@ -171,8 +171,10 @@ class AcarsTest extends TestCase
$response = $this->post($uri, [
'flight_time' => 130,
'fuel_used' => 8000.19,
'distance' => 400,
]);
$response->assertStatus(200);
# Add a comment
@@ -305,7 +307,21 @@ class AcarsTest extends TestCase
]
];
$uri = '/api/pireps/' . $pirep_id . '/acars/log';
$uri = '/api/pireps/' . $pirep_id . '/acars/logs';
$response = $this->post($uri, $post_log);
$response->assertStatus(200);
$body = $response->json();
$this->assertEquals(1, $body['count']);
$acars = factory(App\Models\Acars::class)->make();
$post_log = [
'events' => [
['event' => $acars->log]
]
];
$uri = '/api/pireps/' . $pirep_id . '/acars/events';
$response = $this->post($uri, $post_log);
$response->assertStatus(200);
$body = $response->json();