Refuse pirep prefile is user not allowed to use aircraft #170

This commit is contained in:
Nabeel Shahzad
2018-02-20 12:59:49 -06:00
parent 8393ae2851
commit 4e43223f3a
8 changed files with 137 additions and 42 deletions

View File

@@ -10,13 +10,15 @@ use App\Models\Enums\PirepState;
class PIREPTest extends TestCase
{
protected $pirepSvc;
protected $pirepSvc, $settingsRepo;
public function setUp()
{
parent::setUp(); // TODO: Change the autogenerated stub
$this->addData('base');
$this->pirepSvc = app('App\Services\PIREPService');
$this->settingsRepo = app(SettingRepository::class);
}
protected function createNewRoute()
@@ -246,8 +248,7 @@ class PIREPTest extends TestCase
*/
public function testCancelViaAPI()
{
$this->user = factory(App\Models\User::class)->create();
$pirep = factory(App\Models\Pirep::class)->make(['id'=>''])->toArray();
$pirep = $this->createPirep()->toArray();
$uri = '/api/pireps/prefile';
$response = $this->post($uri, $pirep);