@@ -26,7 +26,7 @@ func TestAccGitlabUser_basic(t *testing.T) {
26
26
Check : resource .ComposeTestCheckFunc (
27
27
testAccCheckGitlabUserExists ("gitlab_user.foo" , & user ),
28
28
testAccCheckGitlabUserAttributes (& user , & testAccGitlabUserExpectedAttributes {
29
- Email :
"listest%[email protected] " ,
29
+ Email :
fmt . Sprintf ( "listest%[email protected] " , rInt ) ,
30
30
Password : fmt .Sprintf ("test%dtt" , rInt ),
31
31
Username : fmt .Sprintf ("listest%d" , rInt ),
32
32
Name : fmt .Sprintf ("foo %d" , rInt ),
@@ -38,13 +38,13 @@ func TestAccGitlabUser_basic(t *testing.T) {
38
38
}),
39
39
),
40
40
},
41
- // Update the user to change the name
41
+ // Update the user to change the name, email, projects_limit and more
42
42
{
43
43
Config : testAccGitlabUserUpdateConfig (rInt ),
44
44
Check : resource .ComposeTestCheckFunc (
45
45
testAccCheckGitlabUserExists ("gitlab_user.foo" , & user ),
46
46
testAccCheckGitlabUserAttributes (& user , & testAccGitlabUserExpectedAttributes {
47
- Email :
"listest%[email protected] " ,
47
+ Email :
fmt . Sprintf ( "listest%[email protected] " , rInt ) ,
48
48
Password : fmt .Sprintf ("test%dtt" , rInt ),
49
49
Username : fmt .Sprintf ("listest%d" , rInt ),
50
50
Name : fmt .Sprintf ("bar %d" , rInt ),
@@ -62,7 +62,7 @@ func TestAccGitlabUser_basic(t *testing.T) {
62
62
Check : resource .ComposeTestCheckFunc (
63
63
testAccCheckGitlabUserExists ("gitlab_user.foo" , & user ),
64
64
testAccCheckGitlabUserAttributes (& user , & testAccGitlabUserExpectedAttributes {
65
- Email :
"listest%[email protected] " ,
65
+ Email :
fmt . Sprintf ( "listest%[email protected] " , rInt ) ,
66
66
Password : fmt .Sprintf ("test%dtt" , rInt ),
67
67
Username : fmt .Sprintf ("listest%d" , rInt ),
68
68
Name : fmt .Sprintf ("foo %d" , rInt ),
@@ -151,6 +151,26 @@ func testAccCheckGitlabUserAttributes(user *gitlab.User, want *testAccGitlabUser
151
151
return fmt .Errorf ("got username %q; want %q" , user .Username , want .Username )
152
152
}
153
153
154
+ if user .Email != want .Email {
155
+ return fmt .Errorf ("got email %q; want %q" , user .Email , want .Email )
156
+ }
157
+
158
+ if user .CanCreateGroup != want .CanCreateGroup {
159
+ return fmt .Errorf ("got can_create_group %t; want %t" , user .CanCreateGroup , want .CanCreateGroup )
160
+ }
161
+
162
+ if user .External != want .External {
163
+ return fmt .Errorf ("got is_external %t; want %t" , user .External , want .External )
164
+ }
165
+
166
+ if user .IsAdmin != want .Admin {
167
+ return fmt .Errorf ("got is_admin %t; want %t" , user .IsAdmin , want .Admin )
168
+ }
169
+
170
+ if user .ProjectsLimit != want .ProjectsLimit {
171
+ return fmt .Errorf ("got projects_limit %d; want %d" , user .ProjectsLimit , want .ProjectsLimit )
172
+ }
173
+
154
174
return nil
155
175
}
156
176
}
0 commit comments