snipe-it/tests/Feature/Departments/Ui/IndexDepartmentsTest.php

24 lines
544 B
PHP
Raw Normal View History

<?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();
}
}