Save workspace changes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
use App\Jobs\SendVerificationEmailJob;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\Queue;
|
||||
|
||||
test('registration screen can be rendered', function () {
|
||||
@@ -23,18 +23,19 @@ test('new users can register', function () {
|
||||
'email' => 'test@example.com',
|
||||
]);
|
||||
|
||||
$this->assertGuest();
|
||||
$response->assertRedirect(route('register.notice', absolute: false));
|
||||
$user = User::query()->where('email', 'test@example.com')->firstOrFail();
|
||||
|
||||
$this->assertAuthenticatedAs($user);
|
||||
$response->assertRedirect(route('setup.password.create', absolute: false));
|
||||
|
||||
$this->assertDatabaseHas('users', [
|
||||
'email' => 'test@example.com',
|
||||
'onboarding_step' => 'email',
|
||||
'is_active' => 0,
|
||||
'onboarding_step' => 'verified',
|
||||
'is_active' => 1,
|
||||
'needs_password_reset' => 1,
|
||||
]);
|
||||
|
||||
$this->assertDatabaseHas('user_verification_tokens', [
|
||||
'user_id' => (int) \App\Models\User::query()->where('email', 'test@example.com')->value('id'),
|
||||
]);
|
||||
|
||||
Queue::assertPushed(SendVerificationEmailJob::class);
|
||||
expect($user->email_verified_at)->toBeNull();
|
||||
$this->assertDatabaseCount('user_verification_tokens', 0);
|
||||
Queue::assertNothingPushed();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user