@@ -230,8 +230,9 @@ func TestGithubOrganizationRulesets(t *testing.T) {
230230 })
231231
232232 t .Run ("Imports rulesets without error" , func (t * testing.T ) {
233+ resourceName := "test-import-rulesets"
233234 config := fmt .Sprintf (`
234- resource "github_organization_ruleset" "test " {
235+ resource "github_organization_ruleset" "%s " {
235236 name = "test-%s"
236237 target = "branch"
237238 enforcement = "active"
@@ -258,6 +259,7 @@ func TestGithubOrganizationRulesets(t *testing.T) {
258259 required_signatures = false
259260
260261 pull_request {
262+ allowed_merge_methods = ["merge", "squash", "rebase"]
261263 required_approving_review_count = 2
262264 required_review_thread_resolution = true
263265 require_code_owner_review = true
@@ -285,10 +287,10 @@ func TestGithubOrganizationRulesets(t *testing.T) {
285287 non_fast_forward = true
286288 }
287289 }
288- ` , randomID )
290+ ` , resourceName , randomID )
289291
290292 check := resource .ComposeTestCheckFunc (
291- resource .TestCheckResourceAttrSet ("github_organization_ruleset.test" , "name" ),
293+ resource .TestCheckResourceAttrSet (fmt . Sprintf ( "github_organization_ruleset.%s" , resourceName ) , "name" ),
292294 )
293295
294296 testCase := func (t * testing.T , mode string ) {
@@ -301,7 +303,7 @@ func TestGithubOrganizationRulesets(t *testing.T) {
301303 Check : check ,
302304 },
303305 {
304- ResourceName : "github_organization_ruleset.test" ,
306+ ResourceName : fmt . Sprintf ( "github_organization_ruleset.%s" , resourceName ) ,
305307 ImportState : true ,
306308 ImportStateVerify : true ,
307309 },
@@ -688,8 +690,9 @@ func TestGithubOrganizationRulesets(t *testing.T) {
688690 })
689691
690692 t .Run ("Validates push target rejects ref_name" , func (t * testing.T ) {
693+ resourceName := "test-push-reject-ref-name"
691694 config := fmt .Sprintf (`
692- resource "github_organization_ruleset" "test " {
695+ resource "github_organization_ruleset" "%s " {
693696 name = "test-push-with-ref-%s"
694697 target = "push"
695698 enforcement = "active"
@@ -709,7 +712,7 @@ func TestGithubOrganizationRulesets(t *testing.T) {
709712 creation = true
710713 }
711714 }
712- ` , randomID )
715+ ` , resourceName , randomID )
713716
714717 testCase := func (t * testing.T , mode string ) {
715718 resource .Test (t , resource.TestCase {
@@ -734,8 +737,9 @@ func TestGithubOrganizationRulesets(t *testing.T) {
734737 })
735738
736739 t .Run ("Validates repository target rejects ref_name" , func (t * testing.T ) {
740+ resourceName := "test-repository-reject-ref-name"
737741 config := fmt .Sprintf (`
738- resource "github_organization_ruleset" "test " {
742+ resource "github_organization_ruleset" "%s " {
739743 name = "test-repo-with-ref-%s"
740744 target = "repository"
741745 enforcement = "active"
@@ -755,7 +759,7 @@ func TestGithubOrganizationRulesets(t *testing.T) {
755759 creation = true
756760 }
757761 }
758- ` , randomID )
762+ ` , resourceName , randomID )
759763
760764 testCase := func (t * testing.T , mode string ) {
761765 resource .Test (t , resource.TestCase {
0 commit comments