Skip to content

Commit

Permalink
Test reset password screen can be seen with token
Browse files Browse the repository at this point in the history
  • Loading branch information
unclexo committed Jan 19, 2023
1 parent 7e26369 commit 2ce0701
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/Feature/NotificationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,22 @@ public function notifying_the_user_while_requesting_reset_password_link()

Notification::assertSentTo($user, ResetPassword::class);
}

/** @test */
public function reset_password_screen_can_be_rendered_with_token()
{
Notification::fake();

$user = User::factory()->create();

$this->post(route('password.email'), ['email' => $user->email]);

Notification::assertSentTo($user, ResetPassword::class, function ($notification) {
$response = $this->get(route('password.reset', $notification->token));

$response->assertStatus(200);

return true;
});
}
}

0 comments on commit 2ce0701

Please sign in to comment.