github.com/koding/terraform@v0.6.4-0.20170608090606-5d7e0339779d/builtin/providers/heroku/import_heroku_pipeline_coupling_test.go (about)

     1  package heroku
     2  
     3  import (
     4  	"fmt"
     5  	"testing"
     6  
     7  	heroku "github.com/cyberdelia/heroku-go/v3"
     8  	"github.com/hashicorp/terraform/helper/acctest"
     9  	"github.com/hashicorp/terraform/helper/resource"
    10  )
    11  
    12  func TestAccHerokuPipelineCoupling_importBasic(t *testing.T) {
    13  	var coupling heroku.PipelineCoupling
    14  
    15  	appName := fmt.Sprintf("tftest-%s", acctest.RandString(10))
    16  	pipelineName := fmt.Sprintf("tftest-%s", acctest.RandString(10))
    17  	stageName := "development"
    18  
    19  	resource.Test(t, resource.TestCase{
    20  		PreCheck:     func() { testAccPreCheck(t) },
    21  		Providers:    testAccProviders,
    22  		CheckDestroy: testAccCheckHerokuPipelineCouplingDestroy,
    23  		Steps: []resource.TestStep{
    24  			{
    25  				Config: testAccCheckHerokuPipelineCouplingConfig_basic(appName, pipelineName, stageName),
    26  				Check: resource.ComposeTestCheckFunc(
    27  					testAccCheckHerokuPipelineCouplingExists("heroku_pipeline_coupling.default", &coupling),
    28  					testAccCheckHerokuPipelineCouplingAttributes(
    29  						&coupling,
    30  						"heroku_pipeline.default",
    31  						stageName,
    32  					),
    33  				),
    34  			},
    35  			{
    36  				ResourceName:            "heroku_pipeline_coupling.default",
    37  				ImportState:             true,
    38  				ImportStateVerify:       true,
    39  				ImportStateVerifyIgnore: []string{"config_vars"},
    40  			},
    41  		},
    42  	})
    43  }