@@ -246,6 +246,33 @@ func TestAccGitlabGroup_disappears(t *testing.T) {
246
246
})
247
247
}
248
248
249
+ func TestAccGitlabGroup_PreventForkingOutsideGroup (t * testing.T ) {
250
+ var group gitlab.Group
251
+ rInt := acctest .RandInt ()
252
+
253
+ resource .Test (t , resource.TestCase {
254
+ PreCheck : func () { testAccPreCheck (t ) },
255
+ ProviderFactories : providerFactories ,
256
+ CheckDestroy : testAccCheckGitlabGroupDestroy ,
257
+ Steps : []resource.TestStep {
258
+ {
259
+ SkipFunc : isRunningInCE ,
260
+ Config : testAccGitlabGroupPreventForkingOutsideGroupConfig (rInt ),
261
+ Check : resource .ComposeTestCheckFunc (
262
+ testAccCheckGitlabGroupExists ("gitlab_group.foo" , & group ),
263
+ func (s * terraform.State ) error {
264
+ if group .PreventForkingOutsideGroup != true {
265
+ return fmt .Errorf ("expected forking outside the group to be disabled" )
266
+ }
267
+
268
+ return nil
269
+ },
270
+ ),
271
+ },
272
+ },
273
+ })
274
+ }
275
+
249
276
func testAccCheckGitlabGroupDisappears (group * gitlab.Group ) resource.TestCheckFunc {
250
277
return func (s * terraform.State ) error {
251
278
_ , err := testGitlabClient .Groups .DeleteGroup (group .ID )
@@ -408,33 +435,6 @@ func testAccCheckGitlabGroupDestroy(s *terraform.State) error {
408
435
return nil
409
436
}
410
437
411
- func TestAccGitlabGroup_PreventForkingOutsideGroup (t * testing.T ) {
412
- var group gitlab.Group
413
- rInt := acctest .RandInt ()
414
-
415
- resource .Test (t , resource.TestCase {
416
- PreCheck : func () { testAccPreCheck (t ) },
417
- ProviderFactories : providerFactories ,
418
- CheckDestroy : testAccCheckGitlabGroupDestroy ,
419
- Steps : []resource.TestStep {
420
- {
421
- SkipFunc : isRunningInCE ,
422
- Config : testAccGitlabGroupPreventForkingOutsideGroupConfig (rInt ),
423
- Check : resource .ComposeTestCheckFunc (
424
- testAccCheckGitlabGroupExists ("gitlab_group.foo" , & group ),
425
- func (s * terraform.State ) error {
426
- if group .PreventForkingOutsideGroup != true {
427
- return fmt .Errorf ("expected forking outside the group to be disabled" )
428
- }
429
-
430
- return nil
431
- },
432
- ),
433
- },
434
- },
435
- })
436
- }
437
-
438
438
func testAccGitlabGroupConfig (rInt int ) string {
439
439
return fmt .Sprintf (`
440
440
resource "gitlab_group" "foo" {
0 commit comments