]> git.localhorst.tv Git - alttp.git/blob - tests/Feature/Auth/PasswordConfirmationTest.php
add aosr slash command
[alttp.git] / tests / Feature / Auth / PasswordConfirmationTest.php
1 <?php
2
3 namespace Tests\Feature\Auth;
4
5 use App\Models\User;
6 use Illuminate\Foundation\Testing\RefreshDatabase;
7 use Tests\TestCase;
8
9 class PasswordConfirmationTest extends TestCase
10 {
11     use RefreshDatabase;
12
13     public function test_confirm_password_screen_can_be_rendered()
14     {
15         $user = User::factory()->create();
16
17         $response = $this->actingAs($user)->get('/confirm-password');
18
19         $response->assertStatus(200);
20     }
21
22     public function test_password_can_be_confirmed()
23     {
24         $user = User::factory()->create();
25
26         $response = $this->actingAs($user)->post('/confirm-password', [
27             'password' => 'password',
28         ]);
29
30         $response->assertRedirect();
31         $response->assertSessionHasNoErrors();
32     }
33
34     public function test_password_is_not_confirmed_with_invalid_password()
35     {
36         $user = User::factory()->create();
37
38         $response = $this->actingAs($user)->post('/confirm-password', [
39             'password' => 'wrong-password',
40         ]);
41
42         $response->assertSessionHasErrors();
43     }
44 }