Skip to content

Commit ed948b6

Browse files
committed
refactor: update password confirmation routes to use named routes
1 parent a5cd0ed commit ed948b6

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

routes/auth.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
Route::get('confirm-password', [ConfirmablePasswordController::class, 'show'])
5050
->name('password.confirm');
5151

52-
Route::post('confirm-password', [ConfirmablePasswordController::class, 'store']);
52+
Route::post('confirm-password', [ConfirmablePasswordController::class, 'store'])
53+
->name('password.confirmation');
5354

5455
Route::post('logout', [AuthenticatedSessionController::class, 'destroy'])
5556
->name('logout');

tests/Feature/Auth/EmailVerificationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function test_email_verification_screen_can_be_rendered()
1717
{
1818
$user = User::factory()->unverified()->create();
1919

20-
$response = $this->actingAs($user)->get('/verify-email');
20+
$response = $this->actingAs($user)->get(round('verification.notice'));
2121

2222
$response->assertStatus(200);
2323
}

tests/Feature/Auth/PasswordConfirmationTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public function test_confirm_password_screen_can_be_rendered()
1414
{
1515
$user = User::factory()->create();
1616

17-
$response = $this->actingAs($user)->get('/confirm-password');
17+
$response = $this->actingAs($user)->get(route('password.confirm'));
1818

1919
$response->assertStatus(200);
2020
}
@@ -23,7 +23,7 @@ public function test_password_can_be_confirmed()
2323
{
2424
$user = User::factory()->create();
2525

26-
$response = $this->actingAs($user)->post('/confirm-password', [
26+
$response = $this->actingAs($user)->post(route('password.confirmation'), [
2727
'password' => 'password',
2828
]);
2929

@@ -35,7 +35,7 @@ public function test_password_is_not_confirmed_with_invalid_password()
3535
{
3636
$user = User::factory()->create();
3737

38-
$response = $this->actingAs($user)->post('/confirm-password', [
38+
$response = $this->actingAs($user)->post(route('password.confirmation'), [
3939
'password' => 'wrong-password',
4040
]);
4141

0 commit comments

Comments
 (0)