<?php

use App\Services\RbacService;
use CodeIgniter\Test\CIUnitTestCase;

/**
 * @internal
 */
final class RbacContractsPermissionTest extends CIUnitTestCase
{
    public function testFacilityManagerCanAccessFinanceContracts(): void
    {
        $rbac = new RbacService();
        $this->assertTrue($rbac->can('facility_manager', 'finance.contracts'));
        $this->assertTrue($rbac->canAccessRoute('facility_manager', 'finance/contracts'));
    }

    public function testQaInspectorCanAccessWorkOrders(): void
    {
        $rbac = new RbacService();
        $this->assertTrue($rbac->canAccessRoute('qa_inspector', 'workorders/view/1'));
    }
}
