Skip to content

A free open source IT asset/license management system

Add authorization test

Marcus Moore69009e027fba
diff --git a/tests/Feature/Users/Api/StoreUsersTest.php b/tests/Feature/Users/Api/StoreUsersTest.php
index f5065c574a..fcc6752310 100644
--- a/tests/Feature/Users/Api/StoreUsersTest.php
+++ b/tests/Feature/Users/Api/StoreUsersTest.php
@@ -10,6 +10,18 @@ use Tests\TestCase;
class StoreUsersTest extends TestCase
{
+ public function testRequiresPermission()
+ {
+ $this->actingAsForApi(User::factory()->create())
+ ->postJson(route('api.users.store'), [
+ 'first_name' => 'Joe',
+ 'username' => 'joe',
+ 'password' => 'joe_password',
+ 'password_confirmation' => 'joe_password',
+ ])
+ ->assertForbidden();
+ }
+
public function testCompanyIdNeedsToBeInteger()
{
$company = Company::factory()->create();