Skip to content

Commit

Permalink
test: add test to check only authorized email can be invited.
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentauger committed Dec 2, 2024
1 parent 56bb044 commit f5472b2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/Feature/UserInvitationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,16 @@

$response->assertOk();
});

test('a user cannot invite a user unless the domain is in the autorized list', function () {
$user = User::factory()->create();

$response = $this->actingAs($user)->postJson('/api/users/invite', [
'first_name' => 'John',
'last_name' => 'Doe',
'email' => '[email protected]',
]);

$response->assertStatus(422);

});

0 comments on commit f5472b2

Please sign in to comment.