Skip to content

Commit 2df5697

Browse files
jmtptCopilot
andcommitted
use ConfigStateChecks instead
Co-authored-by: Copilot <[email protected]>
1 parent cdeca29 commit 2df5697

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

github/resource_github_organization_ruleset_test.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,13 +1441,12 @@ resource "github_organization_ruleset" "test" {
14411441
Steps: []resource.TestStep{
14421442
{
14431443
Config: config,
1444-
Check: resource.ComposeTestCheckFunc(
1445-
resource.TestCheckResourceAttr("github_organization_ruleset.test", "name", rulesetName),
1446-
resource.TestCheckResourceAttr("github_organization_ruleset.test", "enforcement", "active"),
1447-
resource.TestCheckResourceAttr("github_organization_ruleset.test", "bypass_actors.#", "1"),
1448-
resource.TestCheckResourceAttr("github_organization_ruleset.test", "bypass_actors.0.actor_type", "EnterpriseOwner"),
1449-
resource.TestCheckResourceAttr("github_organization_ruleset.test", "bypass_actors.0.bypass_mode", "always"),
1450-
),
1444+
ConfigStateChecks: []statecheck.StateCheck{
1445+
statecheck.ExpectKnownValue("github_organization_ruleset.test", tfjsonpath.New("name"), knownvalue.StringExact(rulesetName)),
1446+
statecheck.ExpectKnownValue("github_organization_ruleset.test", tfjsonpath.New("enforcement"), knownvalue.StringExact("active")),
1447+
statecheck.ExpectKnownValue("github_organization_ruleset.test", tfjsonpath.New("bypass_actors").AtSliceIndex(0).AtMapKey("actor_type"), knownvalue.StringExact("EnterpriseOwner")),
1448+
statecheck.ExpectKnownValue("github_organization_ruleset.test", tfjsonpath.New("bypass_actors").AtSliceIndex(0).AtMapKey("bypass_mode"), knownvalue.StringExact("always")),
1449+
},
14511450
},
14521451
},
14531452
})

0 commit comments

Comments
 (0)