Skip to content

Commit 0e36f03

Browse files
f0sselEmyrk
andauthored
Apply suggestions from code review
Co-authored-by: Steven Masley <Emyrk@users.noreply.github.com>
1 parent f3b7b9a commit 0e36f03

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

coderd/workspaceagents_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -881,8 +881,9 @@ func TestWorkspaceAgentReportStats(t *testing.T) {
881881
t.Run("FailDeleted", func(t *testing.T) {
882882
t.Parallel()
883883

884-
client, db := coderdtest.NewWithDatabase(t, nil)
885-
user := coderdtest.CreateFirstUser(t, client)
884+
owner, db := coderdtest.NewWithDatabase(t, nil)
885+
ownerUser := coderdtest.CreateFirstUser(t, owner)
886+
client, admin := coderdtest.CreateAnotherUser(t, owner, ownerUser.OrganizationID, rbac.RoleTemplateAdmin(), rbac.RoleUserAdmin())
886887
r := dbfake.WorkspaceBuild(t, db, database.Workspace{
887888
OrganizationID: user.OrganizationID,
888889
OwnerID: user.UserID,
@@ -910,7 +911,7 @@ func TestWorkspaceAgentReportStats(t *testing.T) {
910911
require.NoError(t, err)
911912

912913
// nolint:gocritic // using db directly over creating a delete job
913-
err = db.UpdateWorkspaceDeletedByID(dbauthz.AsSystemRestricted(context.Background()), database.UpdateWorkspaceDeletedByIDParams{
914+
err = db.UpdateWorkspaceDeletedByID(dbauthz.As(ctx, coderdtest.AuthzUserSubject(admin)), database.UpdateWorkspaceDeletedByIDParams{
914915
ID: newWorkspace.ID,
915916
Deleted: true,
916917
})

0 commit comments

Comments
 (0)