Auth: convert auth views and verification email to Nova layout
This commit is contained in:
@@ -1,19 +1,37 @@
|
||||
<?php
|
||||
|
||||
use App\Mail\RegistrationVerificationMail;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
|
||||
test('registration screen can be rendered', function () {
|
||||
$response = $this->get('/register');
|
||||
|
||||
$response->assertStatus(200);
|
||||
$response->assertStatus(200)
|
||||
->assertDontSee('name="name"', false)
|
||||
->assertDontSee('name="username"', false)
|
||||
->assertDontSee('name="password"', false)
|
||||
->assertDontSee('name="password_confirmation"', false);
|
||||
});
|
||||
|
||||
test('new users can register', function () {
|
||||
Mail::fake();
|
||||
|
||||
$response = $this->post('/register', [
|
||||
'name' => 'Test User',
|
||||
'email' => 'test@example.com',
|
||||
'password' => 'password',
|
||||
'password_confirmation' => 'password',
|
||||
]);
|
||||
|
||||
$this->assertAuthenticated();
|
||||
$response->assertRedirect(route('dashboard', absolute: false));
|
||||
$this->assertGuest();
|
||||
$response->assertRedirect(route('register.notice', absolute: false));
|
||||
|
||||
$this->assertDatabaseHas('users', [
|
||||
'email' => 'test@example.com',
|
||||
'onboarding_step' => 'email',
|
||||
'is_active' => 0,
|
||||
]);
|
||||
|
||||
$this->assertDatabaseHas('user_verification_tokens', [
|
||||
'user_id' => (int) \App\Models\User::query()->where('email', 'test@example.com')->value('id'),
|
||||
]);
|
||||
|
||||
Mail::assertQueued(RegistrationVerificationMail::class);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user