Files
fluent-chat/tests/Feature/DashboardTest.php
Meghdad b2339d389d
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (8.4) (push) Has been cancelled
tests / ci (8.5) (push) Has been cancelled
Add LazilyRefreshDatabase trait to TestCase
2026-05-01 02:48:15 +03:30

17 lines
404 B
PHP

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