You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
751 B

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