You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
589 B
24 lines
589 B
<?php
|
|
|
|
namespace Tests\iLaravel\Policies;
|
|
|
|
use App\Models\ILaravel;
|
|
use Tests\Bootstrap;
|
|
|
|
class AuthPolicyTest extends Bootstrap
|
|
{
|
|
function test_auth_policy_successful()
|
|
{
|
|
$this->modelWithPolicy('ilaravels', ['auth'])
|
|
->loginAs()
|
|
->getJson(route('api.ilaravels.show', $this->one(ILaravel::class)))
|
|
->assertOk();
|
|
}
|
|
|
|
function test_auth_policy_fail()
|
|
{
|
|
$this->modelWithPolicy('ilaravels', ['auth'])
|
|
->getJson(route('api.ilaravels.show', $this->one(ILaravel::class)))
|
|
->assertForbidden();
|
|
}
|
|
}
|