snipe_it/tests/Feature/Departments/Ui/IndexDepartmentsTest.php
2024-12-16 17:45:10 -08:00

31 lines
756 B
PHP

<?php
namespace Tests\Feature\Departments\Ui;
use App\Models\Component;
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 testPageRenders()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('components.index'))
->assertOk();
}
public function testUserCanListDepartments()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('departments.index'))
->assertOk();
}
}