@@ -12,6 +12,7 @@ func TestAccGithubOrganizationRole(t *testing.T) {
1212 t .Run ("can create an empty organization role" , func (t * testing.T ) {
1313 randomID := acctest .RandStringFromCharSet (5 , acctest .CharSetAlphaNum )
1414 name := fmt .Sprintf ("tf-acc-org-role-%s" , randomID )
15+ baseRole := "none"
1516 config := fmt .Sprintf (`
1617 resource "github_organization_role" "test" {
1718 name = "%s"
@@ -25,12 +26,12 @@ func TestAccGithubOrganizationRole(t *testing.T) {
2526 Steps : []resource.TestStep {
2627 {
2728 Config : config ,
28- Check : resource .ComposeTestCheckFunc (
29+ Check : resource .ComposeAggregateTestCheckFunc (
2930 resource .TestCheckResourceAttrSet ("github_organization_role.test" , "id" ),
3031 resource .TestCheckResourceAttrSet ("github_organization_role.test" , "role_id" ),
3132 resource .TestCheckResourceAttr ("github_organization_role.test" , "name" , name ),
32- resource .TestCheckResourceAttr ("github_organization_role.test" , "base_role" , "none" ),
33- resource .TestCheckResourceAttrSet ("github_organization_role.test" , "permissions.# " ),
33+ resource .TestCheckResourceAttr ("github_organization_role.test" , "base_role" , baseRole ),
34+ resource .TestCheckNoResourceAttr ("github_organization_role.test" , "permissions" ),
3435 resource .TestCheckResourceAttr ("github_organization_role.test" , "permissions.#" , "0" ),
3536 ),
3637 },
@@ -57,11 +58,11 @@ func TestAccGithubOrganizationRole(t *testing.T) {
5758 Steps : []resource.TestStep {
5859 {
5960 Config : config ,
60- Check : resource .ComposeTestCheckFunc (
61+ Check : resource .ComposeAggregateTestCheckFunc (
6162 resource .TestCheckResourceAttrSet ("github_organization_role.test" , "id" ),
6263 resource .TestCheckResourceAttr ("github_organization_role.test" , "name" , name ),
6364 resource .TestCheckResourceAttr ("github_organization_role.test" , "base_role" , baseRole ),
64- resource .TestCheckResourceAttrSet ("github_organization_role.test" , "permissions.# " ),
65+ resource .TestCheckNoResourceAttr ("github_organization_role.test" , "permissions" ),
6566 resource .TestCheckResourceAttr ("github_organization_role.test" , "permissions.#" , "0" ),
6667 ),
6768 },
@@ -167,16 +168,16 @@ func TestAccGithubOrganizationRole(t *testing.T) {
167168 Steps : []resource.TestStep {
168169 {
169170 Config : config ,
170- Check : resource .ComposeTestCheckFunc (
171+ Check : resource .ComposeAggregateTestCheckFunc (
171172 resource .TestCheckResourceAttrSet ("github_organization_role.test" , "id" ),
172173 resource .TestCheckResourceAttrSet ("github_organization_role.test" , "role_id" ),
173174 resource .TestCheckResourceAttr ("github_organization_role.test" , "name" , name ),
174175 resource .TestCheckResourceAttr ("github_organization_role.test" , "description" , description ),
175176 resource .TestCheckResourceAttr ("github_organization_role.test" , "base_role" , baseRole ),
176177 resource .TestCheckResourceAttrSet ("github_organization_role.test" , "permissions.#" ),
177178 resource .TestCheckResourceAttr ("github_organization_role.test" , "permissions.#" , "2" ),
178- resource .TestCheckResourceAttr ("github_organization_role.test" , "permissions.0 " , permission0 ),
179- resource .TestCheckResourceAttr ("github_organization_role.test" , "permissions.1 " , permission1 ),
179+ resource .TestCheckTypeSetElemAttr ("github_organization_role.test" , "permissions.* " , permission0 ),
180+ resource .TestCheckTypeSetElemAttr ("github_organization_role.test" , "permissions.* " , permission1 ),
180181 ),
181182 },
182183 },
0 commit comments