| 123456789101112131415161718192021222324252627 |
- <?php
-
- namespace Tests\Feature;
-
- use App\Models\User;
- use Illuminate\Foundation\Testing\RefreshDatabase;
- use Tests\TestCase;
-
- class DashboardTest extends TestCase
- {
- use RefreshDatabase;
-
- public function test_guests_are_redirected_to_the_login_page()
- {
- $response = $this->get(route('dashboard'));
- $response->assertRedirect(route('login'));
- }
-
- public function test_authenticated_users_can_visit_the_dashboard()
- {
- $user = User::factory()->create();
- $this->actingAs($user);
-
- $response = $this->get(route('dashboard'));
- $response->assertOk();
- }
- }
|