get(route('admin.dashboard')); $response->assertRedirect(route('login')); } public function test_regular_user_is_forbidden(): void { $user = User::factory()->create(); $response = $this->actingAs($user)->get(route('admin.dashboard')); $response->assertForbidden(); } public function test_admin_can_view_dashboard(): void { $admin = User::factory()->create(); $admin->is_admin = true; $admin->save(); $response = $this->actingAs($admin)->get(route('admin.dashboard')); $response->assertOk(); } }