8000 fix cli test · coder/coder@00fe066 · GitHub
[go: up one dir, main page]

Skip to content

Commit 00fe066

Browse files
committed
fix cli test
1 parent 899e802 commit 00fe066

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

cli/rename_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
func TestRename(t *testing.T) {
1616
t.Parallel()
1717

18-
client := coderdtest.New(t, &coderdtest.Options{IncludeProvisionerDaemon: true})
18+
client := coderdtest.New(t, &coderdtest.Options{IncludeProvisionerDaemon: true, AllowWorkspaceRenames: true})
1919
owner := coderdtest.CreateFirstUser(t, client)
2020
member, _ := coderdtest.CreateAnotherUser(t, client, owner.OrganizationID)
2121
version := coderdtest.CreateTemplateVersion(t, client, owner.OrganizationID, nil)

coderd/workspaces.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,13 +632,13 @@ func (api *API) patchWorkspace(rw http.ResponseWriter, r *http.Request) {
632632
name := workspace.Name
633633
if req.Name != "" || req.Name != workspace.Name {
634634
if !api.Options.AllowWorkspaceRenames {
635-
httpapi.Write(ctx, rw, http.StatusForbidden, codersdk.Response{
635+
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
636636
Message: "Workspace renames are not allowed.",
637637
})
638638
return
639639
}
640640
if api.Options.AllowWorkspaceRenamesExpiresAt.Before(time.Now()) {
641-
httpapi.Write(ctx, rw, http.StatusForbidden, codersdk.Response{
641+
httpapi.Write(ctx, rw, http.StatusBadRequest, codersdk.Response{
642642
Message: "Workspace renames are no longer allowed. Flag expired at " + api.Options.AllowWorkspaceRenamesExpiresAt.String(),
643643
})
644644
return

0 commit comments

Comments
 (0)
0