write test for another items and change some part of the code
This commit is contained in:
@@ -16,18 +16,13 @@ class SHowTest extends TestCase
|
||||
{
|
||||
$permission = Permission::factory()->create();
|
||||
|
||||
$response = $this->getJson(route('permissions.show', $permission));
|
||||
$response = $this->getJson(route('permissions.show', [$permission->id]));
|
||||
|
||||
$response->assertUnauthorized();
|
||||
}
|
||||
public function test_permission_show_returns_correct_structure_and_data(): void
|
||||
{
|
||||
$user = User::factory()
|
||||
->has(Permission::factory()->state([
|
||||
'name' => 'manage-permissions',
|
||||
'name_fa' => 'مدیریت دسترسیها',
|
||||
'guard_name' => 'web',
|
||||
]))
|
||||
->create();
|
||||
|
||||
$permission = Permission::factory()->create([
|
||||
@@ -36,7 +31,7 @@ class SHowTest extends TestCase
|
||||
'guard_name' => 'web',
|
||||
]);
|
||||
|
||||
$response = $this->actingAs($user)->getJson(route('permissions.show', $permission));
|
||||
$response = $this->actingAs($user)->getJson(route('permissions.show', [$permission->id]));
|
||||
|
||||
$response->assertOk()
|
||||
->assertJson([
|
||||
|
||||
Reference in New Issue
Block a user