Files
fotospiel-app/tests/Feature/DashboardTest.php

28 lines
642 B
PHP

<?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()
{
$this->get(route('dashboard'))->assertRedirect(route('login'));
}
public function test_authenticated_users_can_visit_the_dashboard()
{
// Create a tenant_admin user for dashboard access
$user = User::factory()->create(['role' => 'tenant_admin']);
$this->actingAs($user);
$this->get(route('dashboard'))->assertOk();
}
}