Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Add test for update status page
Browse files Browse the repository at this point in the history
  • Loading branch information
louy committed Apr 16, 2019
1 parent 55d0379 commit 9829a5e
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions uptimerobot/resource_uptimerobot_status_page_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,45 @@ func TestUptimeRobotDataResourceStatusPage_basic(t *testing.T) {
})
}

func TestUptimeRobotDataResourceStatusPage_update_name(t *testing.T) {
var friendlyName = "TF Test: Update name"
var friendlyName2 = "TF Test: Update name 2"
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckStatusPageDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: fmt.Sprintf(`
resource "uptimerobot_status_page" "test" {
friendly_name = "%s"
}
`, friendlyName),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("uptimerobot_status_page.test", "friendly_name", friendlyName),
resource.TestCheckResourceAttr("uptimerobot_status_page.test", "monitors.#", "1"),
resource.TestCheckResourceAttr("uptimerobot_status_page.test", "monitors.0", "0"),
),
},
resource.TestStep{
Config: fmt.Sprintf(`
resource "uptimerobot_status_page" "test" {
friendly_name = "%s"
}
`, friendlyName2),
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("uptimerobot_status_page.test", "friendly_name", friendlyName2),
),
},
resource.TestStep{
ResourceName: "uptimerobot_status_page.test",
ImportState: true,
ImportStateVerify: true,
},
},
})
}

func TestUptimeRobotDataResourceStatusPage_custom_monitors(t *testing.T) {
var friendlyName = "TF Test: custom monitors"
resource.Test(t, resource.TestCase{
Expand Down

0 comments on commit 9829a5e

Please sign in to comment.