test email signup flow
This commit is contained in:
parent
a95903ed05
commit
9945163a2f
12 changed files with 631 additions and 0 deletions
|
|
@ -78,4 +78,23 @@ class EloquentUserRepositoryTest extends TestCase
|
|||
new EmailAddress('unknown@example.com'),
|
||||
));
|
||||
}
|
||||
|
||||
public function test_it_persists_confirmation_of_a_pending_user(): void
|
||||
{
|
||||
$repository = app(UserRepository::class);
|
||||
$user = $repository->create(new CreateUserDto(
|
||||
email: new EmailAddress('pending@example.com'),
|
||||
passwordHash: null,
|
||||
));
|
||||
|
||||
$this->assertNull($user->getPasswordHash());
|
||||
$user->setPasswordHash('hashed-password');
|
||||
$updatedUser = $repository->update($user);
|
||||
|
||||
$this->assertSame('hashed-password', $updatedUser->getPasswordHash());
|
||||
$this->assertDatabaseHas('users', [
|
||||
'id' => $user->getId(),
|
||||
'passwordHash' => 'hashed-password',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue