Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
sethvargo committed Mar 31, 2017
1 parent c44487c commit 33dd504
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions builtin/providers/github/resource_github_issue_label_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ func TestAccGithubIssueLabel_basic(t *testing.T) {
testAccCheckGithubIssueLabelAttributes(&label, "bar", "FFFFFF"),
),
},
{
Config: testAccGitHubIssueLabelExistsConfig,
Check: resource.ComposeTestCheckFunc(
testAccCheckGithubIssueLabelExists("github_issue_label.test", &label),
testAccCheckGithubIssueLabelAttributes(&label, "enhancement", "FF00FF"),
),
},
},
})
}
Expand Down Expand Up @@ -134,3 +141,16 @@ resource "github_issue_label" "test" {
color = "FFFFFF"
}
`, testRepo)

var testAccGitHubIssueLabelExistsConfig string = fmt.Sprintf(`
// Create a repository which has the default labels
resource "github_repository" "test" {
name = "tf-acc-repo-label-abc1234"
}
resource "github_issue_label" "test" {
repository = "${github_repository.test.name}"
name = "enhancement" // Important! This is a pre-created label
color = "FF00FF"
}
`)

0 comments on commit 33dd504

Please sign in to comment.