snipe-it/tests/Feature/Categories/Ui/IndexCategoriesTest.php
snipe 1f28bf14c1 Added category tests
Signed-off-by: snipe <snipe@snipe.net>
2024-07-05 00:21:58 +01:00

24 lines
536 B
PHP

<?php
namespace Tests\Feature\Categories\Ui;
use App\Models\User;
use Tests\TestCase;
class IndexCategoriesTest extends TestCase
{
public function testPermissionRequiredToViewCategoryList()
{
$this->actingAs(User::factory()->create())
->get(route('categories.index'))
->assertForbidden();
}
public function testUserCanListCategories()
{
$this->actingAs(User::factory()->superuser()->create())
->get(route('categories.index'))
->assertOk();
}
}