DashboardTest.php 338 B

12345678910111213
  1. <?php
  2. use App\Models\User;
  3. test('guests are redirected to the login page', function () {
  4. $this->get(route('dashboard'))->assertRedirect(route('login'));
  5. });
  6. test('authenticated users can visit the dashboard', function () {
  7. $this->actingAs($user = User::factory()->create());
  8. $this->get(route('dashboard'))->assertOk();
  9. });