mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-13 17:14:10 -08:00
Added tests
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
406ff6984b
commit
d635c86e00
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();
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue