Merge pull request #69 from mattn/fix-68

Fix 68
pull/70/head
mattn 2017-11-30 15:00:12 +09:00 committed by GitHub
commit 0d8819ecaf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -27,7 +27,7 @@ type AppConfig struct {
// Application is mastodon application.
type Application struct {
ID int64 `json:"id"`
ID ID `json:"id"`
RedirectURI string `json:"redirect_uri"`
ClientID string `json:"client_id"`
ClientSecret string `json:"client_secret"`

View File

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