@@ -342,18 +342,21 @@ func (s *MethodTestSuite) TestGroup() {
342
342
dbgen .GroupMember (s .T (), db , database.GroupMemberTable {GroupID : g .ID , UserID : u .ID })
343
343
check .Asserts (rbac .ResourceSystem , policy .ActionRead )
344
344
}))
345
- s .Run ("GetGroups" , s .Subtest (func (db database.Store , check * expects ) {
345
+ s .Run ("System/ GetGroups" , s .Subtest (func (db database.Store , check * expects ) {
346
346
_ = dbgen .Group (s .T (), db , database.Group {})
347
- check .Asserts (rbac .ResourceSystem , policy .ActionRead )
347
+ check .Args (database.GetGroupsParams {}).
348
+ Asserts (rbac .ResourceSystem , policy .ActionRead )
348
349
}))
349
- s .Run ("GetGroupsByOrganizationAndUserID " , s .Subtest (func (db database.Store , check * expects ) {
350
+ s .Run ("GetGroups " , s .Subtest (func (db database.Store , check * expects ) {
350
351
g := dbgen .Group (s .T (), db , database.Group {})
351
352
u := dbgen .User (s .T (), db , database.User {})
352
353
gm := dbgen .GroupMember (s .T (), db , database.GroupMemberTable {GroupID : g .ID , UserID : u .ID })
353
- check .Args (database.GetGroupsByOrganizationAndUserIDParams {
354
+ check .Args (database.GetGroupsParams {
354
355
OrganizationID : g .OrganizationID ,
355
- UserID : gm .UserID ,
356
- }).Asserts (g , policy .ActionRead )
356
+ HasMemberID : gm .UserID ,
357
+ }).Asserts (rbac .ResourceSystem , policy .ActionRead , g , policy .ActionRead ).
358
+ // Fail the system resource skip
359
+ FailSystemObjectChecks ()
357
360
}))
358
361
s .Run ("InsertAllUsersGroup" , s .Subtest (func (db database.Store , check * expects ) {
359
362
o := dbgen .Organization (s .T (), db , database.Organization {})
@@ -597,12 +600,16 @@ func (s *MethodTestSuite) TestLicense() {
597
600
}
598
601
599
602
func (s * MethodTestSuite ) TestOrganization () {
600
- s .Run ("GetGroupsByOrganizationID " , s .Subtest (func (db database.Store , check * expects ) {
603
+ s .Run ("ByOrganization/GetGroups " , s .Subtest (func (db database.Store , check * expects ) {
601
604
o := dbgen .Organization (s .T (), db , database.Organization {})
602
605
a := dbgen .Group (s .T (), db , database.Group {OrganizationID : o .ID })
603
606
b := dbgen .Group (s .T (), db , database.Group {OrganizationID : o .ID })
604
- check .Args (o .ID ).Asserts (a , policy .ActionRead , b , policy .ActionRead ).
605
- Returns ([]database.Group {a , b })
607
+ check .Args (database.GetGroupsParams {
608
+ OrganizationID : o .ID ,
609
+ }).Asserts (rbac .ResourceSystem , policy .ActionRead , a , policy .ActionRead , b , policy .ActionRead ).
610
+ Returns ([]database.Group {a , b }).
611
+ // Fail the system check shortcut
612
+ FailSystemObjectChecks ()
606
613
}))
607
614
s .Run ("GetOrganizationByID" , s .Subtest (func (db database.Store , check * expects ) {
608
615
o := dbgen .Organization (s .T (), db , database.Organization {})
0 commit comments