complete story 1.3 with qa test & added future recommendations to the dev
This commit is contained in:
@@ -2,15 +2,28 @@
|
||||
|
||||
use App\Models\User;
|
||||
|
||||
test('guests are redirected to the login page', function () {
|
||||
$response = $this->get(route('dashboard'));
|
||||
test('guests are redirected to the login page for admin dashboard', function () {
|
||||
$response = $this->get('/admin/dashboard');
|
||||
$response->assertRedirect(route('login'));
|
||||
});
|
||||
|
||||
test('authenticated users can visit the dashboard', function () {
|
||||
$user = User::factory()->create();
|
||||
test('guests are redirected to the login page for client dashboard', function () {
|
||||
$response = $this->get('/client/dashboard');
|
||||
$response->assertRedirect(route('login'));
|
||||
});
|
||||
|
||||
test('authenticated admin can visit admin dashboard', function () {
|
||||
$user = User::factory()->admin()->create();
|
||||
$this->actingAs($user);
|
||||
|
||||
$response = $this->get(route('dashboard'));
|
||||
$response = $this->get('/admin/dashboard');
|
||||
$response->assertStatus(200);
|
||||
});
|
||||
});
|
||||
|
||||
test('authenticated client can visit client dashboard', function () {
|
||||
$user = User::factory()->individual()->create();
|
||||
$this->actingAs($user);
|
||||
|
||||
$response = $this->get('/client/dashboard');
|
||||
$response->assertStatus(200);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user