write test for another items and change some part of the code

This commit is contained in:
2025-05-14 15:38:33 +03:30
parent db8cda55df
commit 16fe0be555
20 changed files with 1258 additions and 45 deletions

View File

@@ -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'));