@@ -28,6 +28,7 @@ func TestAccGitlabRepositoryFile_basic(t *testing.T) {
28
28
FilePath : "meow.txt" ,
29
29
Content : "bWVvdyBtZW93IG1lb3c=" ,
30
30
}),
31
+ resource .TestCheckResourceAttr ("gitlab_repository_file.this" , "content" , "bWVvdyBtZW93IG1lb3c=" ),
31
32
),
32
33
},
33
34
{
@@ -44,6 +45,7 @@ func TestAccGitlabRepositoryFile_basic(t *testing.T) {
44
45
FilePath : "meow.txt" ,
45
46
Content : "bWVvdyBtZW93IG1lb3cgbWVvdyBtZW93Cg==" ,
46
47
}),
48
+ resource .TestCheckResourceAttr ("gitlab_repository_file.this" , "content" , "bWVvdyBtZW93IG1lb3cgbWVvdyBtZW93Cg==" ),
47
49
),
48
50
},
49
51
{
@@ -168,6 +170,7 @@ func TestAccGitlabRepositoryFile_base64EncodingWithTextContent(t *testing.T) {
168
170
FilePath : "meow.txt" ,
169
171
Content : "SGVsbG8gV29ybGQsIG1lb3c=" ,
170
172
}),
173
+ resource .TestCheckResourceAttr ("gitlab_repository_file.this" , "content" , "Hello World, meow" ),
171
174
),
172
175
},
173
176
// Update content
@@ -189,9 +192,10 @@ func TestAccGitlabRepositoryFile_base64EncodingWithTextContent(t *testing.T) {
189
192
FilePath : "meow.txt" ,
190
193
Content : "SGVsbG8gV29ybGQsIG1lb3cgVVBEQVRFRA==" ,
191
194
}),
195
+ resource .TestCheckResourceAttr ("gitlab_repository_file.this" , "content" , "Hello World, meow UPDATED" ),
192
196
),
193
197
},
194
- // Update to already base64 encoded content, but same content, yields in an empty plan
198
+ // Update to already base64 encoded content, but same content
195
199
{
196
200
Config : fmt .Sprintf (`
197
201
resource "gitlab_repository_file" "this" {
@@ -204,7 +208,7 @@ func TestAccGitlabRepositoryFile_base64EncodingWithTextContent(t *testing.T) {
204
208
commit_message = "feature: add launch codes"
205
209
}
206
210
` , testProject .ID ),
207
- PlanOnly : true ,
211
+ Check : resource . TestCheckResourceAttr ( "gitlab_repository_file.this" , "content" , "SGVsbG8gV29ybGQsIG1lb3cgVVBEQVRFRA==" ) ,
208
212
},
209
213
// Update content and already base64 encode it
210
214
{
@@ -225,9 +229,10 @@ func TestAccGitlabRepositoryFile_base64EncodingWithTextContent(t *testing.T) {
225
229
FilePath : "meow.txt" ,
226
230
Content : "bWVvdyBtZW93IG1lb3c=" ,
227
231
}),
232
+ resource .TestCheckResourceAttr ("gitlab_repository_file.this" , "content" , "bWVvdyBtZW93IG1lb3c=" ),
228
233
),
229
234
},
230
- // Update to not-yet base64 encoded content, but same content, yields in an empty plan
235
+ // Update to not-yet base64 encoded content, but same content
231
236
{
232
237
Config : fmt .Sprintf (`
233
238
resource "gitlab_repository_file" "this" {
@@ -240,7 +245,7 @@ func TestAccGitlabRepositoryFile_base64EncodingWithTextContent(t *testing.T) {
240
245
commit_message = "feature: add launch codes"
241
246
}
242
247
` , testProject .ID ),
243
- PlanOnly : true ,
248
+ Check : resource . TestCheckResourceAttr ( "gitlab_repository_file.this" , "content" , "meow meow meow" ) ,
244
249
},
245
250
},
246
251
})
0 commit comments