singleloginsystem/tests/Feature/DashboardTest.php
2026-05-08 07:19:08 +00:00

19 lines
442 B
PHP

<?php
declare(strict_types=1);
use App\Models\User;
test('guests are redirected to the login page', function (): void {
$response = $this->get(route('dashboard'));
$response->assertRedirect(route('login'));
});
test('authenticated users can visit the dashboard', function (): void {
$user = User::factory()->create();
$this->actingAs($user);
$response = $this->get(route('dashboard'));
$response->assertOk();
});