Fail during conf init if auth or token URL is not valid.

This commit is contained in:
Burcu Dogan
2014-07-20 16:56:38 -07:00
parent 7935ece62b
commit 70bd497612
5 changed files with 35 additions and 41 deletions

View File

@@ -36,10 +36,7 @@ func newTestConf() *Config {
func TestAuthCodeURL(t *testing.T) {
conf := newTestConf()
url, err := conf.AuthCodeURL("foo")
if err != nil {
t.Fatalf("Expected to generate an auth URL, failed with %v.", err)
}
url := conf.AuthCodeURL("foo")
if url != "auth-url?access_type=offline&approval_prompt=force&client_id=CLIENT_ID&redirect_uri=REDIRECT_URL&response_type=code&scope=scope1+scope2&state=foo" {
t.Fatalf("Generated auth URL is not the expected. Found %v.", url)
}