pull/69/head
Yasuhiro Matsumoto 2017-11-30 14:55:18 +09:00
parent 83242d96ca
commit a98b28c817
1 changed files with 4 additions and 1 deletions

View File

@ -26,7 +26,7 @@ func TestRegisterApp(t *testing.T) {
fmt.Fprintln(w, `<html><head><title>Apps</title></head></html>`) fmt.Fprintln(w, `<html><head><title>Apps</title></head></html>`)
return return
} }
fmt.Fprintln(w, `{"client_id": "foo", "client_secret": "bar"}`) fmt.Fprintln(w, `{"id": 123, "client_id": "foo", "client_secret": "bar"}`)
return return
})) }))
defer ts.Close() defer ts.Close()
@ -64,6 +64,9 @@ func TestRegisterApp(t *testing.T) {
if err != nil { if err != nil {
t.Fatalf("should not be fail: %v", err) t.Fatalf("should not be fail: %v", err)
} }
if string(app.ID) != "123" {
t.Fatalf("want %q but %q", "bar", app.ClientSecret)
}
if app.ClientID != "foo" { if app.ClientID != "foo" {
t.Fatalf("want %q but %q", "foo", app.ClientID) t.Fatalf("want %q but %q", "foo", app.ClientID)
} }