1234567891011121314151617181920212223242526272829303132 |
- <?php
- use App\Models\User;
- test('confirm password screen can be rendered', function () {
- $user = User::factory()->create();
- $response = $this->actingAs($user)->get(route('password.confirm'));
- $response->assertStatus(200);
- });
- test('password can be confirmed', function () {
- $user = User::factory()->create();
- $response = $this->actingAs($user)->post(route('password.confirm.store'), [
- 'password' => 'password',
- ]);
- $response->assertRedirect();
- $response->assertSessionHasNoErrors();
- });
- test('password is not confirmed with invalid password', function () {
- $user = User::factory()->create();
- $response = $this->actingAs($user)->post(route('password.confirm.store'), [
- 'password' => 'wrong-password',
- ]);
- $response->assertSessionHasErrors();
- });
|