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.
27 lines
639 B
27 lines
639 B
<?php
|
|
|
|
namespace Tests\iLaravel\Policies;
|
|
|
|
use App\Models\ILaravel;
|
|
use Tests\Bootstrap;
|
|
|
|
class GroupPolicyTest extends Bootstrap
|
|
{
|
|
function test_group_policy_successful()
|
|
{
|
|
$this->modelWithPolicy('ilaravels', ['group'])
|
|
->loginAs()
|
|
->getJson(route('api.ilaravels.show', $this->one(ILaravel::class)))
|
|
->assertOk();
|
|
}
|
|
|
|
function test_group_policy_fail()
|
|
{
|
|
$this->modelWithPolicy('ilaravels', ['group'])
|
|
->loginAs()
|
|
->getJson(route('api.ilaravels.show', $this->one(ILaravel::class, ['group_id' => 0])))
|
|
->assertForbidden();
|
|
}
|
|
|
|
|
|
}
|