3 namespace Tests\Feature\Auth;
6 use Illuminate\Foundation\Testing\RefreshDatabase;
9 class PasswordConfirmationTest extends TestCase
13 public function test_confirm_password_screen_can_be_rendered()
15 $user = User::factory()->create();
17 $response = $this->actingAs($user)->get('/confirm-password');
19 $response->assertStatus(200);
22 public function test_password_can_be_confirmed()
24 $user = User::factory()->create();
26 $response = $this->actingAs($user)->post('/confirm-password', [
27 'password' => 'password',
30 $response->assertRedirect();
31 $response->assertSessionHasNoErrors();
34 public function test_password_is_not_confirmed_with_invalid_password()
36 $user = User::factory()->create();
38 $response = $this->actingAs($user)->post('/confirm-password', [
39 'password' => 'wrong-password',
42 $response->assertSessionHasErrors();