Skip to content

Commit

Permalink
Merge pull request #227 from terraform-providers/rfd-topic-validation
Browse files Browse the repository at this point in the history
Move topic validation tests into the correct test method
  • Loading branch information
ryndaniels authored May 10, 2019
2 parents 244b053 + 79fc8b7 commit deea7f2
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions github/resource_github_repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,18 +278,6 @@ func TestAccGithubRepository_templates(t *testing.T) {
Providers: testAccProviders,
CheckDestroy: testAccCheckGithubRepositoryDestroy,
Steps: []resource.TestStep{
{
Config: testAccGithubRepositoryConfigTopics(randString, `"TOPIC"`),
ExpectError: regexp.MustCompile(`must include only lowercase alphanumeric characters or hyphens and cannot start with a hyphen`),
},
{
Config: testAccGithubRepositoryConfigTopics(randString, `"-topic"`),
ExpectError: regexp.MustCompile(`must include only lowercase alphanumeric characters or hyphens and cannot start with a hyphen`),
},
{
Config: testAccGithubRepositoryConfigTopics(randString, `"töpic"`),
ExpectError: regexp.MustCompile(`must include only lowercase alphanumeric characters or hyphens and cannot start with a hyphen`),
},
{
Config: testAccGithubRepositoryConfigTemplates(randString),
Check: resource.ComposeTestCheckFunc(
Expand Down Expand Up @@ -327,6 +315,18 @@ func TestAccGithubRepository_topics(t *testing.T) {
Providers: testAccProviders,
CheckDestroy: testAccCheckGithubRepositoryDestroy,
Steps: []resource.TestStep{
{
Config: testAccGithubRepositoryConfigTopics(randString, `"TOPIC"`),
ExpectError: regexp.MustCompile(`must include only lowercase alphanumeric characters or hyphens and cannot start with a hyphen`),
},
{
Config: testAccGithubRepositoryConfigTopics(randString, `"-topic"`),
ExpectError: regexp.MustCompile(`must include only lowercase alphanumeric characters or hyphens and cannot start with a hyphen`),
},
{
Config: testAccGithubRepositoryConfigTopics(randString, `"töpic"`),
ExpectError: regexp.MustCompile(`must include only lowercase alphanumeric characters or hyphens and cannot start with a hyphen`),
},
{
Config: testAccGithubRepositoryConfigTopics(randString, `"topic1", "topic2"`),
Check: resource.ComposeTestCheckFunc(
Expand Down

0 comments on commit deea7f2

Please sign in to comment.