From 14b80abc29fb986377939a42496e09a85cc7210d Mon Sep 17 00:00:00 2001 From: Jack Pearkes Date: Tue, 29 Jul 2014 19:16:01 -0400 Subject: [PATCH] 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. --- builtin/providers/heroku/resource_heroku_drain_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/builtin/providers/heroku/resource_heroku_drain_test.go b/builtin/providers/heroku/resource_heroku_drain_test.go index 7ff5d3a37..9a848ac98 100644 --- a/builtin/providers/heroku/resource_heroku_drain_test.go +++ b/builtin/providers/heroku/resource_heroku_drain_test.go @@ -26,8 +26,6 @@ func TestAccHerokuDrain_Basic(t *testing.T) { "heroku_drain.foobar", "url", "syslog://terraform.example.com:1234"), resource.TestCheckResourceAttr( "heroku_drain.foobar", "app", "terraform-test-app"), - resource.TestCheckResourceAttr( - "heroku_drain.foobar", "token", "foo-bar-baz-qux"), ), }, }, @@ -59,6 +57,10 @@ func testAccCheckHerokuDrainAttributes(Drain *heroku.LogDrain) resource.TestChec return fmt.Errorf("Bad URL: %s", Drain.URL) } + if Drain.Token == "" { + return fmt.Errorf("No token: %#v", Drain) + } + return nil } }