test(auth): cover password reset expiration
This commit is contained in:
@@ -18,7 +18,9 @@ class ResetPasswordAttemptTest extends TestCase
|
||||
'id',
|
||||
'user_id',
|
||||
'codigo',
|
||||
'reason',
|
||||
'status',
|
||||
'expires_at',
|
||||
], Schema::getColumnListing('reset_password_attempts'));
|
||||
}
|
||||
|
||||
@@ -28,12 +30,14 @@ class ResetPasswordAttemptTest extends TestCase
|
||||
|
||||
$attempt = $user->resetPasswordAttempts()->create([
|
||||
'codigo' => '123456',
|
||||
'expires_at' => now()->addHour(),
|
||||
]);
|
||||
|
||||
$this->assertSame(ResetPasswordAttempt::STATUS_PENDING, $attempt->status);
|
||||
$this->assertTrue($attempt->user->is($user));
|
||||
$this->assertTrue($user->resetPasswordAttempts->contains($attempt));
|
||||
$this->assertFalse($attempt->usesTimestamps());
|
||||
$this->assertTrue($attempt->expires_at->isFuture());
|
||||
$this->assertArrayNotHasKey('codigo', $attempt->toArray());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user