Skip to content

Commit 52dacce

Browse files
committed
fix dbauthz tests
1 parent e53fd08 commit 52dacce

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

coderd/database/dbauthz/dbauthz_test.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2777,15 +2777,14 @@ func (s *MethodTestSuite) TestFrobulators() {
27772777
s.Run("GetFrobulators", s.Subtest(func(db database.Store, check *expects) {
27782778
user := dbgen.User(s.T(), db, database.User{})
27792779
org := dbgen.Organization(s.T(), db, database.Organization{})
2780+
// Create a frobulator resource.
2781+
fr := dbgen.Frobulator(s.T(), db, database.Frobulator{UserID: user.ID, OrgID: org.ID})
2782+
// Assert that calling GetFrobulators with the user and org ID records a
2783+
// read action on the above resource.
27802784
check.Args(database.GetFrobulatorsParams{
27812785
UserID: user.ID,
27822786
OrgID: org.ID,
2783-
}).Asserts(
2784-
rbac.ResourceFrobulator.
2785-
WithOwner(user.ID.String()).
2786-
InOrg(org.ID),
2787-
policy.ActionRead,
2788-
)
2787+
}).Asserts(fr, policy.ActionRead)
27892788
}))
27902789
s.Run("InsertFrobulator", s.Subtest(func(db database.Store, check *expects) {
27912790
user := dbgen.User(s.T(), db, database.User{})

0 commit comments

Comments
 (0)