fix bug where aircraft restrictions aren't respected in flight calls #170

This commit is contained in:
Nabeel Shahzad
2018-02-09 14:26:14 -06:00
parent 71189e4f2d
commit f6b2102e48
6 changed files with 135 additions and 15 deletions

View File

@@ -1,18 +1,22 @@
<?php
use App\Services\FlightService;
use App\Models\Flight;
use App\Models\User;
use App\Models\UserBid;
use App\Repositories\SettingRepository;
use App\Services\FlightService;
class FlightTest extends TestCase
{
protected $flightSvc, $settingsRepo;
public function setUp()
{
parent::setUp();
$this->addData('base');
$this->flightSvc = app(FlightService::class);
$this->settingsRepo = app(SettingRepository::class);
}
public function addFlight($user)
@@ -168,7 +172,7 @@ class FlightTest extends TestCase
*/
public function testMultipleBidsSingleFlight()
{
setting('bids.disable_flight_on_bid', true);
$this->settingsRepo->store('bids.disable_flight_on_bid', true);
$user1 = factory(User::class)->create();
$user2 = factory(User::class)->create([
@@ -224,11 +228,4 @@ class FlightTest extends TestCase
$body = $req->json();
$this->assertEquals(0, sizeof($body));
}
public function testRestrictedFlights()
{
setting('bids.disable_flight_on_bid', true);
}
}