Skip to content

Commit f23940d

Browse files
committed
fix: fix test
1 parent 4a9ab5e commit f23940d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

coderd/database/dbauthz/dbauthz_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ func (s *MethodTestSuite) TestOrganization() {
839839
_ = dbgen.OrganizationMember(s.T(), db, database.OrganizationMember{UserID: u.ID, OrganizationID: a.ID})
840840
b := dbgen.Organization(s.T(), db, database.Organization{})
841841
_ = dbgen.OrganizationMember(s.T(), db, database.OrganizationMember{UserID: u.ID, OrganizationID: b.ID})
842-
check.Args(u.ID).Asserts(a, policy.ActionRead, b, policy.ActionRead).Returns(slice.New(a, b))
842+
check.Args(database.GetOrganizationsByUserIDParams{UserID: u.ID, Deleted: false}).Asserts(a, policy.ActionRead, b, policy.ActionRead).Returns(slice.New(a, b))
843843
}))
844844
s.Run("InsertOrganization", s.Subtest(func(db database.Store, check *expects) {
845845
check.Args(database.InsertOrganizationParams{
@@ -960,13 +960,14 @@ func (s *MethodTestSuite) TestOrganization() {
960960
Name: "something-different",
961961
}).Asserts(o, policy.ActionUpdate)
962962
}))
963-
s.Run("DeleteOrganization", s.Subtest(func(db database.Store, check *expects) {
963+
s.Run("UpdateOrganizationDeletedByID", s.Subtest(func(db database.Store, check *expects) {
964964
o := dbgen.Organization(s.T(), db, database.Organization{
965965
Name: "doomed",
966966
})
967-
check.Args(
968-
o.ID,
969-
).Asserts(o, policy.ActionDelete)
967+
check.Args(database.UpdateOrganizationDeletedByIDParams{
968+
ID: o.ID,
969+
UpdatedAt: o.UpdatedAt,
970+
}).Asserts(o, policy.ActionDelete).Returns()
970971
}))
971972
s.Run("OrganizationMembers", s.Subtest(func(db database.Store, check *expects) {
972973
o := dbgen.Organization(s.T(), db, database.Organization{})

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy