<?php

namespace Tests\Feature;

use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;

class GuestAccessTest extends TestCase
{
    use RefreshDatabase;

    public function test_guest_is_redirected_from_protected_main_pages(): void
    {
        $protectedRoutes = [
            'dashboard',
            'items.index',
            'borrow.index',
            'item-requests.index',
            'rooms.index',
            'vehicles.index',
            'returns.index',
            'history.index',
            'verification.index',
            'reports.index',
        ];

        foreach ($protectedRoutes as $routeName) {
            $response = $this->get(route($routeName));

            $response->assertRedirect(route('login'));
        }
    }
}
