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.
This commit is contained in:
Jack Pearkes 2014-07-29 19:16:01 -04:00
parent d3e8454ceb
commit 14b80abc29
1 changed files with 4 additions and 2 deletions

View File

@ -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
}
}