<?php

use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;

uses(RefreshDatabase::class);

it('denies non-admin users access to admin panel', function () {
    $user = User::factory()->create();
    $this->actingAs($user);

    $this->get('/admin')->assertForbidden();
});

it('allows admin users to access admin panel', function () {
    $user = User::factory()->admin()->create();
    $this->actingAs($user);

    $this->get('/admin')->assertOk();
});
