Skip to content

Commit 14b80ab

Browse files
committed
providers/heroku: fix drain test
cc/ @bmarini Basically, the attr check we have in our tests is looking at resources that we specify. It's basically check that "if I send this, I get this" from the external resource. In this case, we don't know what the token will be, so we can't do it that way. I replaced it with a "make sure this is more than an empty string" assertion.
1 parent d3e8454 commit 14b80ab

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

builtin/providers/heroku/resource_heroku_drain_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ func TestAccHerokuDrain_Basic(t *testing.T) {
2626
"heroku_drain.foobar", "url", "syslog://terraform.example.com:1234"),
2727
resource.TestCheckResourceAttr(
2828
"heroku_drain.foobar", "app", "terraform-test-app"),
29-
resource.TestCheckResourceAttr(
30-
"heroku_drain.foobar", "token", "foo-bar-baz-qux"),
3129
),
3230
},
3331
},
@@ -59,6 +57,10 @@ func testAccCheckHerokuDrainAttributes(Drain *heroku.LogDrain) resource.TestChec
5957
return fmt.Errorf("Bad URL: %s", Drain.URL)
6058
}
6159

60+
if Drain.Token == "" {
61+
return fmt.Errorf("No token: %#v", Drain)
62+
}
63+
6264
return nil
6365
}
6466
}

0 commit comments

Comments
 (0)