Auth: convert auth views and verification email to Nova layout
This commit is contained in:
54
tests/Feature/Auth/EnsureOnboardingCompleteTest.php
Normal file
54
tests/Feature/Auth/EnsureOnboardingCompleteTest.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
|
||||
it('redirects verified step user to setup password from profile', function () {
|
||||
$user = User::factory()->create([
|
||||
'onboarding_step' => 'verified',
|
||||
]);
|
||||
|
||||
$this->actingAs($user)
|
||||
->get('/profile')
|
||||
->assertRedirect('/setup/password');
|
||||
});
|
||||
|
||||
it('redirects password step user to setup username from upload', function () {
|
||||
$user = User::factory()->create([
|
||||
'onboarding_step' => 'password',
|
||||
]);
|
||||
|
||||
$this->actingAs($user)
|
||||
->get('/upload')
|
||||
->assertRedirect('/setup/username');
|
||||
});
|
||||
|
||||
it('redirects email step user to login from forum and gallery', function () {
|
||||
$user = User::factory()->create([
|
||||
'onboarding_step' => 'email',
|
||||
]);
|
||||
|
||||
$this->actingAs($user)
|
||||
->get('/forum')
|
||||
->assertRedirect('/login');
|
||||
|
||||
$this->actingAs($user)
|
||||
->get('/gallery/1/test')
|
||||
->assertRedirect('/login');
|
||||
});
|
||||
|
||||
it('allows complete onboarding user to access profile and upload', function () {
|
||||
$user = User::factory()->create([
|
||||
'onboarding_step' => 'complete',
|
||||
]);
|
||||
|
||||
$this->actingAs($user)
|
||||
->get('/profile')
|
||||
->assertOk();
|
||||
|
||||
$this->actingAs($user)
|
||||
->get('/upload')
|
||||
->assertOk();
|
||||
});
|
||||
Reference in New Issue
Block a user