diff --git a/tests/Feature/Depreciations/Api/DepreciationsIndexTest.php b/tests/Feature/Depreciations/Api/DepreciationsIndexTest.php new file mode 100644 index 000000000..29583001a --- /dev/null +++ b/tests/Feature/Depreciations/Api/DepreciationsIndexTest.php @@ -0,0 +1,17 @@ +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 000000000..90cb39b4e --- /dev/null +++ b/tests/Feature/Depreciations/Ui/DepreciationsIndexTest.php @@ -0,0 +1,23 @@ +actingAs(User::factory()->create()) + ->get(route('depreciations.index')) + ->assertForbidden(); + } + + public function testUserCanListDepreciations() + { + $this->actingAs(User::factory()->admin()->create()) + ->get(route('depreciations.index')) + ->assertOk(); + } +}