snipe_it/tests/Feature/Departments/Ui/IndexDepartmentsTest.php
2024-08-06 20:25:22 +00:00

23 lines
562 B
PHP

<?php
namespace Tests\Feature\Departments\Ui;
use App\Models\User;
use Tests\TestCase;
final class IndexDepartmentsTest extends TestCase
{
public function testPermissionRequiredToViewDepartmentsList(): void
{
$this->actingAs(User::factory()->create())
->get(route('departments.index'))
->assertForbidden();
}
public function testUserCanListDepartments(): void
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('departments.index'))
->assertOk();
}
}