Skip to content

Commit 4e23ea7

Browse files
committed
Fix unit test assertion
1 parent a92f132 commit 4e23ea7

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

cli/autostart_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func TestAutostart(t *testing.T) {
109109
clitest.SetupConfig(t, client, root)
110110

111111
err := cmd.Execute()
112-
require.ErrorContains(t, err, "status code 403: Forbidden", "unexpected error")
112+
require.ErrorContains(t, err, "status code 404", "unexpected error")
113113
})
114114

115115
t.Run("Disable_NotFound", func(t *testing.T) {
@@ -126,7 +126,7 @@ func TestAutostart(t *testing.T) {
126126
clitest.SetupConfig(t, client, root)
127127

128128
err := cmd.Execute()
129-
require.ErrorContains(t, err, "status code 403: Forbidden", "unexpected error")
129+
require.ErrorContains(t, err, "status code 404:", "unexpected error")
130130
})
131131

132132
t.Run("Enable_DefaultSchedule", func(t *testing.T) {

cli/ttl_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func TestTTL(t *testing.T) {
149149
clitest.SetupConfig(t, client, root)
150150

151151
err := cmd.Execute()
152-
require.ErrorContains(t, err, "status code 403: Forbidden", "unexpected error")
152+
require.ErrorContains(t, err, "status code 404:", "unexpected error")
153153
})
154154

155155
t.Run("Unset_NotFound", func(t *testing.T) {
@@ -166,7 +166,7 @@ func TestTTL(t *testing.T) {
166166
clitest.SetupConfig(t, client, root)
167167

168168
err := cmd.Execute()
169-
require.ErrorContains(t, err, "status code 403: Forbidden", "unexpected error")
169+
require.ErrorContains(t, err, "status code 404:", "unexpected error")
170170
})
171171

172172
t.Run("TemplateMaxTTL", func(t *testing.T) {

coderd/files_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func TestDownload(t *testing.T) {
5050
_, _, err := client.Download(context.Background(), "something")
5151
var apiErr *codersdk.Error
5252
require.ErrorAs(t, err, &apiErr)
53-
require.Equal(t, http.StatusForbidden, apiErr.StatusCode())
53+
require.Equal(t, http.StatusNotFound, apiErr.StatusCode())
5454
})
5555

5656
t.Run("Insert", func(t *testing.T) {

coderd/organizations_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func TestOrganizationByUserAndName(t *testing.T) {
3030
_, err := client.OrganizationByName(context.Background(), codersdk.Me, "nothing")
3131
var apiErr *codersdk.Error
3232
require.ErrorAs(t, err, &apiErr)
33-
require.Equal(t, http.StatusForbidden, apiErr.StatusCode())
33+
require.Equal(t, http.StatusNotFound, apiErr.StatusCode())
3434
})
3535

3636
t.Run("NoMember", func(t *testing.T) {

coderd/workspaces_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ func TestWorkspaceByOwnerAndName(t *testing.T) {
295295
// Then:
296296
// When we call without includes_deleted, we don't expect to get the workspace back
297297
_, err = client.WorkspaceByOwnerAndName(context.Background(), workspace.OwnerName, workspace.Name, codersdk.WorkspaceByOwnerAndNameParams{})
298-
require.ErrorContains(t, err, "403")
298+
require.ErrorContains(t, err, "404")
299299

300300
// Then:
301301
// When we call with includes_deleted, we should get the workspace back

0 commit comments

Comments
 (0)