Make sure stdclass is returned in flight fields

This commit is contained in:
Nabeel Shahzad
2020-10-29 12:38:40 -04:00
parent a58237b04b
commit 0fa00206ce
2 changed files with 12 additions and 4 deletions

View File

@@ -113,12 +113,20 @@ class FlightTest extends TestCase
*/
public function testSearchFlight()
{
/** @var \App\Models\User user */
$this->user = factory(User::class)->create();
$flight = $this->addFlight($this->user);
/** @var \App\Services\FlightService $flightSvc */
$flightSvc = app(FlightService::class);
$flightSvc->updateCustomFields($flight, [
['name' => '0', 'value' => 'value'],
]);
// search specifically for a flight ID
$query = 'flight_id='.$flight->id;
$req = $this->get('/api/flights/search?'.$query);
$body = $req->json(['data']);
$req->assertStatus(200);
}