feat(users): enforce active email uniqueness per role
This commit is contained in:
@@ -56,6 +56,17 @@ class StaffControllerTest extends TestCase
|
||||
]);
|
||||
}
|
||||
|
||||
public function test_staff_email_can_be_shared_with_adminapp_and_customers(): void
|
||||
{
|
||||
Sanctum::actingAs($this->admin);
|
||||
User::factory()->create(['email' => $this->admin->email]);
|
||||
$payload = ['nombre_apellido' => 'Shared', 'dni' => '12345678',
|
||||
'email' => strtoupper($this->admin->email), 'category_ids' => [$this->createCategory('Tickets')->id]];
|
||||
$response = $this->postJson('/api/v1/adminapp/tenant/staff', $payload)->assertSuccessful();
|
||||
$this->putJson('/api/v1/adminapp/tenant/staff/'.$response->json('data.id'), $payload)->assertOk();
|
||||
$this->postJson('/api/v1/adminapp/tenant/staff', $payload)->assertUnprocessable()->assertJsonValidationErrors('email');
|
||||
}
|
||||
|
||||
public function test_adminapp_can_create_update_list_and_delete_staff_with_categories(): void
|
||||
{
|
||||
Sanctum::actingAs($this->admin);
|
||||
|
||||
Reference in New Issue
Block a user