@@ -11,15 +11,15 @@ import (
11
11
"github.com/coder/coder/coderd/util/slice"
12
12
)
13
13
14
- func (suite * MethodTestSuite ) TestGroup () {
15
- suite .Run ("DeleteGroupByID" , func () {
16
- suite .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
14
+ func (s * MethodTestSuite ) TestGroup () {
15
+ s .Run ("DeleteGroupByID" , func () {
16
+ s .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
17
17
g := dbgen .Group (t , db , database.Group {})
18
18
return methodCase (values (g .ID ), asserts (g , rbac .ActionDelete ), values ())
19
19
})
20
20
})
21
- suite .Run ("DeleteGroupMemberFromGroup" , func () {
22
- suite .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
21
+ s .Run ("DeleteGroupMemberFromGroup" , func () {
22
+ s .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
23
23
g := dbgen .Group (t , db , database.Group {})
24
24
m := dbgen .GroupMember (t , db , database.GroupMember {
25
25
GroupID : g .ID ,
@@ -30,37 +30,37 @@ func (suite *MethodTestSuite) TestGroup() {
30
30
}), asserts (g , rbac .ActionUpdate ), values ())
31
31
})
32
32
})
33
- suite .Run ("GetGroupByID" , func () {
34
- suite .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
33
+ s .Run ("GetGroupByID" , func () {
34
+ s .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
35
35
g := dbgen .Group (t , db , database.Group {})
36
36
return methodCase (values (g .ID ), asserts (g , rbac .ActionRead ), values (g ))
37
37
})
38
38
})
39
- suite .Run ("GetGroupByOrgAndName" , func () {
40
- suite .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
39
+ s .Run ("GetGroupByOrgAndName" , func () {
40
+ s .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
41
41
g := dbgen .Group (t , db , database.Group {})
42
42
return methodCase (values (database.GetGroupByOrgAndNameParams {
43
43
OrganizationID : g .OrganizationID ,
44
44
Name : g .Name ,
45
45
}), asserts (g , rbac .ActionRead ), values (g ))
46
46
})
47
47
})
48
- suite .Run ("GetGroupMembers" , func () {
49
- suite .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
48
+ s .Run ("GetGroupMembers" , func () {
49
+ s .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
50
50
g := dbgen .Group (t , db , database.Group {})
51
51
_ = dbgen .GroupMember (t , db , database.GroupMember {})
52
52
return methodCase (values (g .ID ), asserts (g , rbac .ActionRead ), nil )
53
53
})
54
54
})
55
- suite .Run ("InsertAllUsersGroup" , func () {
56
- suite .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
55
+ s .Run ("InsertAllUsersGroup" , func () {
56
+ s .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
57
57
o := dbgen .Organization (t , db , database.Organization {})
58
58
return methodCase (values (o .ID ), asserts (rbac .ResourceGroup .InOrg (o .ID ), rbac .ActionCreate ),
59
59
nil )
60
60
})
61
61
})
62
- suite .Run ("InsertGroup" , func () {
63
- suite .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
62
+ s .Run ("InsertGroup" , func () {
63
+ s .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
64
64
o := dbgen .Organization (t , db , database.Organization {})
65
65
return methodCase (values (database.InsertGroupParams {
66
66
OrganizationID : o .ID ,
@@ -69,8 +69,8 @@ func (suite *MethodTestSuite) TestGroup() {
69
69
nil )
70
70
})
71
71
})
72
- suite .Run ("InsertGroupMember" , func () {
73
- suite .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
72
+ s .Run ("InsertGroupMember" , func () {
73
+ s .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
74
74
g := dbgen .Group (t , db , database.Group {})
75
75
return methodCase (values (database.InsertGroupMemberParams {
76
76
UserID : uuid .New (),
@@ -79,8 +79,8 @@ func (suite *MethodTestSuite) TestGroup() {
79
79
values ())
80
80
})
81
81
})
82
- suite .Run ("InsertUserGroupsByName" , func () {
83
- suite .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
82
+ s .Run ("InsertUserGroupsByName" , func () {
83
+ s .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
84
84
o := dbgen .Organization (t , db , database.Organization {})
85
85
u1 := dbgen .User (t , db , database.User {})
86
86
g1 := dbgen .Group (t , db , database.Group {OrganizationID : o .ID })
@@ -93,8 +93,8 @@ func (suite *MethodTestSuite) TestGroup() {
93
93
}), asserts (rbac .ResourceGroup .InOrg (o .ID ), rbac .ActionUpdate ), values ())
94
94
})
95
95
})
96
- suite .Run ("DeleteGroupMembersByOrgAndUser" , func () {
97
- suite .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
96
+ s .Run ("DeleteGroupMembersByOrgAndUser" , func () {
97
+ s .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
98
98
o := dbgen .Organization (t , db , database.Organization {})
99
99
u1 := dbgen .User (t , db , database.User {})
100
100
g1 := dbgen .Group (t , db , database.Group {OrganizationID : o .ID })
@@ -107,8 +107,8 @@ func (suite *MethodTestSuite) TestGroup() {
107
107
}), asserts (rbac .ResourceGroup .InOrg (o .ID ), rbac .ActionUpdate ), values ())
108
108
})
109
109
})
110
- suite .Run ("UpdateGroupByID" , func () {
111
- suite .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
110
+ s .Run ("UpdateGroupByID" , func () {
111
+ s .RunMethodTest (func (t * testing.T , db database.Store ) MethodCase {
112
112
g := dbgen .Group (t , db , database.Group {})
113
113
return methodCase (values (database.UpdateGroupByIDParams {
114
114
ID : g .ID ,
0 commit comments