create(); $workspace = Workspace::factory()->create(); WorkspaceMembership::factory()->create([ 'workspace_id' => (int) $workspace->getKey(), 'user_id' => (int) $user->getKey(), 'role' => 'owner', ]); session()->forget(WorkspaceContext::SESSION_KEY); $this->actingAs($user) ->get('/admin/onboarding') ->assertRedirect('/admin/choose-workspace'); }); it('renders the onboarding wizard at /admin/onboarding when a workspace is selected', function (): void { $user = User::factory()->create(); $workspace = Workspace::factory()->create(); WorkspaceMembership::factory()->create([ 'workspace_id' => (int) $workspace->getKey(), 'user_id' => (int) $user->getKey(), 'role' => 'owner', ]); session()->put(WorkspaceContext::SESSION_KEY, (int) $workspace->getKey()); $this->actingAs($user) ->get('/admin/onboarding') ->assertSuccessful(); });