From 83242d96ca5a2220bd6654f23b5c27b2b38c93e6 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Thu, 30 Nov 2017 14:53:54 +0900 Subject: [PATCH 1/2] fix #68 --- apps.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps.go b/apps.go index 6d7552f..301fa6f 100644 --- a/apps.go +++ b/apps.go @@ -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"` From a98b28c817fa2c903fa8d825c1c77bb03cafc76d Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Thu, 30 Nov 2017 14:55:18 +0900 Subject: [PATCH 2/2] add test --- apps_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps_test.go b/apps_test.go index bab20bf..f62bf15 100644 --- a/apps_test.go +++ b/apps_test.go @@ -26,7 +26,7 @@ func TestRegisterApp(t *testing.T) { fmt.Fprintln(w, `Apps`) 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) }