From ef1332c96bc28464cca926e33ab81477c00c38ee Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Mon, 30 Sep 2019 16:54:15 +0900 Subject: [PATCH] Fix contact_account --- instance.go | 2 +- instance_test.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/instance.go b/instance.go index 3217450..d74322f 100644 --- a/instance.go +++ b/instance.go @@ -16,7 +16,7 @@ type Instance struct { URLs map[string]string `json:"urls,omitempty"` Stats *InstanceStats `json:"stats,omitempty"` Languages []string `json:"languages"` - ContactAccount *Account `json:"account"` + ContactAccount *Account `json:"contact_account"` } // InstanceStats hold information for mastodon instance stats. diff --git a/instance_test.go b/instance_test.go index 4a87ae3..42f1e69 100644 --- a/instance_test.go +++ b/instance_test.go @@ -17,7 +17,7 @@ func TestGetInstance(t *testing.T) { http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError) return } - fmt.Fprintln(w, `{"title": "mastodon", "uri": "http://mstdn.example.com", "description": "test mastodon", "email": "mstdn@mstdn.example.com"}`) + fmt.Fprintln(w, `{"title": "mastodon", "uri": "http://mstdn.example.com", "description": "test mastodon", "email": "mstdn@mstdn.example.com", "contact_account": {"username": "mattn"}}`) })) defer ts.Close() @@ -47,6 +47,9 @@ func TestGetInstance(t *testing.T) { if ins.EMail != "mstdn@mstdn.example.com" { t.Fatalf("want %q but %q", "mstdn@mstdn.example.com", ins.EMail) } + if ins.ContactAccount.Username != "mattn" { + t.Fatalf("want %q but %q", "mattn", ins.ContactAccount.Username) + } } func TestGetInstanceMore(t *testing.T) {