Files
AFC-Demo/tests/Feature/DashboardTest.php
T

16 lines
410 B
PHP
Raw Normal View History

2025-10-16 14:22:46 +02:00
<?php
use App\Models\User;
2025-10-16 14:22:58 +02:00
test('guests are redirected to the login page', function () {
$response = $this->get(route('dashboard'));
$response->assertRedirect(route('login'));
});
2025-10-16 14:22:46 +02:00
2025-10-16 14:22:58 +02:00
test('authenticated users can visit the dashboard', function () {
$user = User::factory()->create();
$this->actingAs($user);
2025-10-16 14:22:46 +02:00
2025-10-16 14:22:58 +02:00
$response = $this->get(route('dashboard'));
$response->assertStatus(200);
});