mirror of
https://github.com/snipe/snipe-it.git
synced 2026-02-20 03:35:52 +00:00
17
tests/Feature/Depreciations/Api/DepreciationsIndexTest.php
Normal file
17
tests/Feature/Depreciations/Api/DepreciationsIndexTest.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Depreciations\Api;
|
||||
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class DepreciationsIndexTest extends TestCase
|
||||
{
|
||||
public function testViewingDepreciationIndexRequiresPermission()
|
||||
{
|
||||
$this->actingAsForApi(User::factory()->create())
|
||||
->getJson(route('api.departments.index'))
|
||||
->assertForbidden();
|
||||
}
|
||||
|
||||
}
|
||||
23
tests/Feature/Depreciations/Ui/DepreciationsIndexTest.php
Normal file
23
tests/Feature/Depreciations/Ui/DepreciationsIndexTest.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\Categories\Ui;
|
||||
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class DepreciationsIndexTest extends TestCase
|
||||
{
|
||||
public function testPermissionRequiredToViewDepreciationsList()
|
||||
{
|
||||
$this->actingAs(User::factory()->create())
|
||||
->get(route('depreciations.index'))
|
||||
->assertForbidden();
|
||||
}
|
||||
|
||||
public function testUserCanListDepreciations()
|
||||
{
|
||||
$this->actingAs(User::factory()->admin()->create())
|
||||
->get(route('depreciations.index'))
|
||||
->assertOk();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user