Separated laravel app to its own folder (#540)

This commit is contained in:
Julien Nahum
2024-08-26 18:24:56 +02:00
committed by GitHub
parent 39b8df5eed
commit 5bd1dda504
546 changed files with 124 additions and 143 deletions

View File

@@ -0,0 +1,36 @@
<?php
it('can create and delete Workspace', function () {
$user = $this->actingAsUser();
for ($i = 1; $i <= 3; $i++) {
$this->postJson(route('open.workspaces.create'), [
'name' => 'Workspace Test - '.$i,
'icon' => '🧪',
])
->assertSuccessful()
->assertJson([
'type' => 'success',
'message' => 'Workspace created.',
]);
}
expect($user->workspaces()->count())->toBe(3);
$i = 0;
foreach ($user->workspaces as $workspace) {
$i++;
if ($i !== 3) {
$this->deleteJson(route('open.workspaces.delete', $workspace->id))
->assertSuccessful()
->assertJson([
'type' => 'success',
'message' => 'Workspace deleted.',
]);
} else {
// Last workspace can not delete
$this->deleteJson(route('open.workspaces.delete', $workspace->id))
->assertStatus(403);
}
}
});