mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
feat: don't return 200 for deleted workspaces (#1556)
This commit is contained in:
@ -4,6 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
@ -470,6 +471,9 @@ func mustTransitionWorkspace(t *testing.T, client *codersdk.Client, workspaceID
|
||||
func mustWorkspace(t *testing.T, client *codersdk.Client, workspaceID uuid.UUID) codersdk.Workspace {
|
||||
ctx := context.Background()
|
||||
ws, err := client.Workspace(ctx, workspaceID)
|
||||
if err != nil && strings.Contains(err.Error(), "status code 410") {
|
||||
ws, err = client.DeletedWorkspace(ctx, workspaceID)
|
||||
}
|
||||
require.NoError(t, err, "no workspace found with id %s", workspaceID)
|
||||
return ws
|
||||
}
|
||||
|
Reference in New Issue
Block a user