snipe-it/tests/Feature/Departments/Ui/IndexDepartmentsTest.php
snipe 0a7e053985 Added basic Department UI tests
Signed-off-by: snipe <snipe@snipe.net>
2024-07-05 07:53:02 +01:00

24 lines
544 B
PHP

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