@@ -29,6 +29,7 @@ func TestAccGitlabProjectBadge_basic(t *testing.T) {
29
29
testAccCheckGitlabProjectBadgeAttributes (& badge , & testAccGitlabProjectBadgeExpectedAttributes {
30
30
LinkURL : fmt .Sprintf ("https://example.com/badge-%d" , rInt ),
31
31
ImageURL : fmt .Sprintf ("https://example.com/badge-%d.svg" , rInt ),
32
+ Name : fmt .Sprintf ("badge-%d" , rInt ),
32
33
}),
33
34
),
34
35
},
@@ -46,6 +47,7 @@ func TestAccGitlabProjectBadge_basic(t *testing.T) {
46
47
testAccCheckGitlabProjectBadgeAttributes (& badge , & testAccGitlabProjectBadgeExpectedAttributes {
47
48
LinkURL : fmt .Sprintf ("https://example.com/badge-%d" , rInt ),
48
49
ImageURL : fmt .Sprintf ("https://example.com/badge-%d.svg" , rInt ),
50
+ Name : fmt .Sprintf ("badge-%d" , rInt ),
49
51
}),
50
52
),
51
53
},
@@ -83,6 +85,7 @@ func testAccCheckGitlabProjectBadgeExists(n string, badge *gitlab.ProjectBadge)
83
85
type testAccGitlabProjectBadgeExpectedAttributes struct {
84
86
LinkURL string
85
87
ImageURL string
88
+ Name string
86
89
}
87
90
88
91
func testAccCheckGitlabProjectBadgeAttributes (badge * gitlab.ProjectBadge , want * testAccGitlabProjectBadgeExpectedAttributes ) resource.TestCheckFunc {
@@ -95,6 +98,10 @@ func testAccCheckGitlabProjectBadgeAttributes(badge *gitlab.ProjectBadge, want *
95
98
return fmt .Errorf ("got image_url %s; want %s" , badge .ImageURL , want .ImageURL )
96
99
}
97
100
101
+ if badge .Name != want .Name {
102
+ return fmt .Errorf ("got name %q; want %q" , badge .Name , want .Name )
103
+ }
104
+
98
105
return nil
99
106
}
100
107
}
@@ -136,8 +143,9 @@ resource "gitlab_project_badge" "foo" {
136
143
project = "${gitlab_project.foo.id}"
137
144
link_url = "https://example.com/badge-%d"
138
145
image_url = "https://example.com/badge-%d.svg"
146
+ name = "badge-%d"
139
147
}
140
- ` , rInt , rInt , rInt )
148
+ ` , rInt , rInt , rInt , rInt )
141
149
}
142
150
143
151
func testAccGitlabProjectBadgeUpdateConfig (rInt int ) string {
@@ -155,6 +163,7 @@ resource "gitlab_project_badge" "foo" {
155
163
project = "${gitlab_project.foo.id}"
156
164
link_url = "https://example.com/badge-%d"
157
165
image_url = "https://example.com/badge-%d.svg"
166
+ name = "badge-%d"
158
167
}
159
- ` , rInt , rInt , rInt )
168
+ ` , rInt , rInt , rInt , rInt )
160
169
}
0 commit comments