mirror of
https://github.com/10h30/Test-Laravel-Auth-Basics.git
synced 2026-07-11 18:56:14 +09:00
New task - password confirmation
This commit is contained in:
@@ -116,4 +116,18 @@ class AuthenticationTest extends TestCase
|
||||
$response = $this->get('/secretpage');
|
||||
$response->assertOk();
|
||||
}
|
||||
|
||||
public function test_password_confirmation_page()
|
||||
{
|
||||
$user = User::factory()->create();
|
||||
$response = $this->actingAs($user)->get('/verysecretpage');
|
||||
$response->assertRedirect('/confirm-password');
|
||||
|
||||
$response = $this->actingAs($user)->post('/confirm-password', [
|
||||
'password' => 'password',
|
||||
]);
|
||||
|
||||
$response->assertRedirect();
|
||||
$response->assertSessionHasNoErrors();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user