TenantAtlas/tests/Feature/ManagedTenants/TenantlessRoutesTest.php
2026-02-01 10:49:19 +01:00

33 lines
950 B
PHP

<?php
declare(strict_types=1);
use App\Models\Tenant;
it('serves the managed-tenant list route without a tenant route prefix', function (): void {
$tenant = Tenant::factory()->create();
[$user] = createUserWithTenant($tenant, role: 'owner');
$this->actingAs($user)
->get('/admin/managed-tenants')
->assertOk();
});
it('serves the managed-tenant view route without a tenant route prefix', function (): void {
$tenant = Tenant::factory()->create();
[$user] = createUserWithTenant($tenant, role: 'owner');
$this->actingAs($user)
->get("/admin/managed-tenants/{$tenant->id}")
->assertOk();
});
it('serves the managed-tenant edit route without a tenant route prefix', function (): void {
$tenant = Tenant::factory()->create();
[$user] = createUserWithTenant($tenant, role: 'owner');
$this->actingAs($user)
->get("/admin/managed-tenants/{$tenant->id}/edit")
->assertOk();
});