Filter out flights depending on the only_flights_from_current setting #174

This commit is contained in:
Nabeel Shahzad
2018-02-09 15:36:13 -06:00
parent 9b55a9691f
commit 17f1085ffb
3 changed files with 32 additions and 9 deletions

View File

@@ -160,6 +160,11 @@ class UserTest extends TestCase
/*
* Do some sanity checks first
*/
# Make sure no flights are filtered out
$this->settingsRepo->store('pilots.only_flights_from_current', false);
# And restrict the aircraft
$this->settingsRepo->store('pireps.restrict_aircraft_to_rank', false);
$response = $this->get('/api/flights/' . $flight->id, [], $user);
@@ -183,8 +188,8 @@ class UserTest extends TestCase
* Make sure it's filtered out from the flight list
*/
$response = $this->get('/api/flights', [], $user);
$response->assertStatus(200);
$body = $response->json();
$response->assertStatus(200);
$this->assertCount(1, $body['data'][0]['subfleets']);
/**