|
0
|
1 <?php
|
|
|
2
|
|
|
3 namespace Tests\Feature\Auth;
|
|
|
4
|
|
|
5 use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
|
6 use Tests\TestCase;
|
|
|
7
|
|
|
8 class RegistrationTest extends TestCase
|
|
|
9 {
|
|
|
10 use RefreshDatabase;
|
|
|
11
|
|
|
12 public function test_registration_screen_can_be_rendered(): void
|
|
|
13 {
|
|
|
14 $response = $this->get('/register');
|
|
|
15
|
|
|
16 $response->assertStatus(200);
|
|
|
17 }
|
|
|
18
|
|
|
19 public function test_new_users_can_register(): void
|
|
|
20 {
|
|
|
21 $response = $this->post('/register', [
|
|
|
22 'name' => 'Test User',
|
|
|
23 'email' => 'test@example.com',
|
|
|
24 'password' => 'password',
|
|
|
25 'password_confirmation' => 'password',
|
|
|
26 ]);
|
|
|
27
|
|
|
28 $this->assertAuthenticated();
|
|
|
29 $response->assertRedirect(route('dashboard', absolute: false));
|
|
|
30 }
|
|
|
31 }
|