test-yield/tests/Feature/Auth/RegistrationTest.php
2024-12-03 21:27:44 +01:00

26 lines
616 B
PHP

<?php
declare(strict_types=1);
use function Pest\Laravel\assertAuthenticated;
use function Pest\Laravel\get;
use function Pest\Laravel\post;
test('registration screen can be rendered', function () {
$response = get('/register');
$response->assertStatus(200);
});
test('new users can register', function () {
$response = post('/register', [
'name' => 'Test User',
'email' => 'test@example.com',
'password' => 'password',
'password_confirmation' => 'password',
]);
assertAuthenticated();
$response->assertRedirect(route('dashboard', absolute: false));
});