Skip to content

Beautiful Open-Source Form Builder

509 B
Raw Blame
<?php

use App\Models\User;

it('checks email uniqueness using the normalized address', function () {
    $user = $this->actingAsUser();
    User::factory()->create(['email' => '[email protected]']);
    $this->patchJson('/settings/profile', [
        'name' => $user->name,
        'email' => '[email protected]',
        'current_password' => 'Abcd@1234',
    ])->assertUnprocessable()->assertJsonValidationErrors('email');
    expect($user->fresh()->email)->not->toBe('[email protected]');
});