|
0
|
1 <?php
|
|
|
2
|
|
|
3 use App\Models\User;
|
|
|
4
|
|
|
5 test('confirm password screen can be rendered', function () {
|
|
|
6 $user = User::factory()->create();
|
|
|
7
|
|
|
8 $response = $this->actingAs($user)->get('/confirm-password');
|
|
|
9
|
|
|
10 $response->assertStatus(200);
|
|
|
11 });
|
|
|
12
|
|
|
13 test('password can be confirmed', function () {
|
|
|
14 $user = User::factory()->create();
|
|
|
15
|
|
|
16 $response = $this->actingAs($user)->post('/confirm-password', [
|
|
|
17 'password' => 'password',
|
|
|
18 ]);
|
|
|
19
|
|
|
20 $response->assertRedirect();
|
|
|
21 $response->assertSessionHasNoErrors();
|
|
|
22 });
|
|
|
23
|
|
|
24 test('password is not confirmed with invalid password', function () {
|
|
|
25 $user = User::factory()->create();
|
|
|
26
|
|
|
27 $response = $this->actingAs($user)->post('/confirm-password', [
|
|
|
28 'password' => 'wrong-password',
|
|
|
29 ]);
|
|
|
30
|
|
|
31 $response->assertSessionHasErrors();
|
|
|
32 });
|