github.com/richardbowden/terraform@v0.6.12-0.20160901200758-30ea22c25211/builtin/providers/digitalocean/import_digitalocean_domain_test.go (about)

     1  package digitalocean
     2  
     3  import (
     4  	"testing"
     5  
     6  	"fmt"
     7  
     8  	"github.com/hashicorp/terraform/helper/acctest"
     9  	"github.com/hashicorp/terraform/helper/resource"
    10  )
    11  
    12  func TestAccDigitalOceanDomain_importBasic(t *testing.T) {
    13  	resourceName := "digitalocean_domain.foobar"
    14  	domainName := fmt.Sprintf("foobar-test-terraform-%s.com", acctest.RandString(10))
    15  
    16  	resource.Test(t, resource.TestCase{
    17  		PreCheck:     func() { testAccPreCheck(t) },
    18  		Providers:    testAccProviders,
    19  		CheckDestroy: testAccCheckDigitalOceanDomainDestroy,
    20  		Steps: []resource.TestStep{
    21  			resource.TestStep{
    22  				Config: fmt.Sprintf(testAccCheckDigitalOceanDomainConfig_basic, domainName),
    23  			},
    24  
    25  			resource.TestStep{
    26  				ResourceName:      resourceName,
    27  				ImportState:       true,
    28  				ImportStateVerify: true,
    29  				ImportStateVerifyIgnore: []string{
    30  					"ip_address"}, //we ignore the IP Address as we do not set to state
    31  			},
    32  		},
    33  	})
    34  }