@@ -382,7 +382,7 @@ func TestAccGithubRepository(t *testing.T) {
382382 })
383383 })
384384
385- t .Run ("configures topics for a repository " , func (t * testing.T ) {
385+ t .Run ("configures_topics_for_a_repository " , func (t * testing.T ) {
386386 randomID := acctest .RandStringFromCharSet (5 , acctest .CharSetAlphaNum )
387387 testRepoName := fmt .Sprintf ("%stopic-%s" , testResourcePrefix , randomID )
388388 config := fmt .Sprintf (`
@@ -393,20 +393,29 @@ func TestAccGithubRepository(t *testing.T) {
393393 }
394394 ` , testRepoName )
395395
396- check := resource .ComposeTestCheckFunc (
397- resource .TestCheckResourceAttr (
398- "github_repository.test" , "topics.#" ,
399- "2" ,
400- ),
401- )
402-
403396 resource .Test (t , resource.TestCase {
404397 PreCheck : func () { skipUnauthenticated (t ) },
405398 ProviderFactories : providerFactories ,
406399 Steps : []resource.TestStep {
407400 {
408401 Config : config ,
409- Check : check ,
402+ Check : resource .ComposeTestCheckFunc (
403+ resource .TestCheckResourceAttr (
404+ "github_repository.test" , "topics.#" ,
405+ "2" ,
406+ ),
407+ ),
408+ },
409+ {
410+ Config : strings .Replace (config ,
411+ `topics = ["terraform", "testing"]` ,
412+ `topics = ["terraform", "testing", "extra-topic"]` , 1 ),
413+ Check : resource .ComposeTestCheckFunc (
414+ resource .TestCheckResourceAttr (
415+ "github_repository.test" , "topics.#" ,
416+ "3" ,
417+ ),
418+ ),
410419 },
411420 },
412421 })
0 commit comments