write test for another items and change some part of the code
This commit is contained in:
@@ -12,21 +12,16 @@ class IndexTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase, WithFaker;
|
||||
|
||||
public function test_unauthenticated_user_cannot_access_permission_index(): void
|
||||
|
||||
public function test_unauthenticated_user_cannot_access(): void
|
||||
{
|
||||
$response = $this->getJson(route('permissions.index'));
|
||||
|
||||
$response->assertStatus(401);
|
||||
$response->assertUnauthorized();
|
||||
}
|
||||
|
||||
public function test_all_permissions_returned_successfully(): void
|
||||
{
|
||||
$user = User::factory()
|
||||
->has(Permission::factory()->state([
|
||||
'name' => 'permissions',
|
||||
'name_fa' => 'مدیریت دسترسی',
|
||||
'guard_name' => 'web',
|
||||
]))
|
||||
->create();
|
||||
|
||||
$response = $this->actingAs($user)->getJson(route('permissions.index'));
|
||||
|
||||
Reference in New Issue
Block a user