2022-04-27 18:41:16 -07:00
|
|
|
<?php
|
|
|
|
|
2022-04-27 19:33:19 -07:00
|
|
|
use App\Models\Collective;
|
|
|
|
use function Pest\Faker\faker;
|
2022-04-27 18:41:16 -07:00
|
|
|
|
2022-04-27 19:33:19 -07:00
|
|
|
uses()->group('owned', 'admin');
|
|
|
|
|
|
|
|
beforeEach(function () {
|
|
|
|
$this->user = Collective::first();
|
|
|
|
$this->request = [
|
|
|
|
'categories' => [rand(1, 57), rand(1, 57), rand(1, 57)],
|
|
|
|
'url' => faker()->url,
|
|
|
|
'subject' => faker()->word,
|
|
|
|
'approved' => faker()->boolean,
|
|
|
|
];
|
|
|
|
});
|
|
|
|
|
|
|
|
it('has owned create page', function () {
|
|
|
|
$response = $this->actingAs($this->user)->get('/fanatic/owned/create');
|
|
|
|
|
|
|
|
$response->assertViewIs('admin.owned.create');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('hides owned create page from guests', function () {
|
|
|
|
$response = $this->get('/fanatic/owned/create');
|
|
|
|
|
|
|
|
$response->assertRedirect('/fanatic/login');
|
2022-04-27 18:41:16 -07:00
|
|
|
});
|