Add authorization test

This commit is contained in:
Marcus Moore 2025-03-05 11:34:45 -08:00
parent 695c9d070f
commit 69009e027f
No known key found for this signature in database

View file

@ -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();