Skip to content

A free open source IT asset/license management system

Added tests

sniped635c86e0096
diff --git a/tests/Feature/Depreciations/Api/DepreciationsIndexTest.php b/tests/Feature/Depreciations/Api/DepreciationsIndexTest.php
new file mode 100644
index 0000000000..29583001ab
--- /dev/null
+++ b/tests/Feature/Depreciations/Api/DepreciationsIndexTest.php
@@ -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();
+ }
+
+}
diff --git a/tests/Feature/Depreciations/Ui/DepreciationsIndexTest.php b/tests/Feature/Depreciations/Ui/DepreciationsIndexTest.php
new file mode 100644
index 0000000000..90cb39b4ee
--- /dev/null
+++ b/tests/Feature/Depreciations/Ui/DepreciationsIndexTest.php
@@ -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();
+ }
+}