26 lines
703 B
PHP
26 lines
703 B
PHP
<?php
|
|
|
|
use Spatie\Permission\Models\Role;
|
|
|
|
test('registration screen can be rendered', function () {
|
|
$response = $this->get('/register');
|
|
|
|
$response->assertStatus(200);
|
|
});
|
|
|
|
test('new users can register', function () {
|
|
// Ensure the default role exists (not seeded in test DB)
|
|
Role::firstOrCreate(['name' => 'User', 'guard_name' => 'web']);
|
|
|
|
$response = $this->post('/register', [
|
|
'name' => 'Test User',
|
|
'email' => 'test@example.com',
|
|
'password' => 'Password1!',
|
|
'password_confirmation' => 'Password1!',
|
|
'agree_tos_pdp' => '1',
|
|
]);
|
|
|
|
$this->assertAuthenticated();
|
|
$response->assertRedirect(route('dashboard', absolute: false));
|
|
});
|