Files
coolify/docs/v5/archive/tests/Feature/V5/V5CreateAuthorizationTest.php.txt
T
Andras Bacsai 76030a30d4 chore(v5): archive V5 implementation and remove runtime integration
Move V5 source, migrations, UI, scripts, and tests into documentation, then remove V5 routes, models, jobs, configuration, dependencies, and application hooks.
2026-08-15 19:13:30 +02:00

34 lines
1010 B
Plaintext

<?php
use App\Models\V5\Application as V5Application;
use App\Models\V5\ResourceConnection;
beforeEach(function () {
resetV5DashboardTestState();
createSharedUserAndTeamTables();
});
it('prevents team members from creating v5 applications', function () {
[$user, $team] = createV5UserWithTeam();
$user->teams()->updateExistingPivot($team->id, ['role' => 'member']);
$this->actingAs($user)
->withSession(['currentTeam' => $team])
->postJson('/v5/applications/nginx')
->assertForbidden();
expect(V5Application::query()->count())->toBe(0);
});
it('prevents team members from creating v5 resource connections', function () {
[$user, $team] = createV5UserWithTeam();
$user->teams()->updateExistingPivot($team->id, ['role' => 'member']);
$this->actingAs($user)
->withSession(['currentTeam' => $team])
->postJson('/v5/resource-connections')
->assertForbidden();
expect(ResourceConnection::query()->count())->toBe(0);
});