Fix contact_account

pull/118/head
Yasuhiro Matsumoto 2019-09-30 16:54:15 +09:00 committed by mattn
parent 1b7f743892
commit ef1332c96b
2 changed files with 5 additions and 2 deletions

View File

@ -16,7 +16,7 @@ type Instance struct {
URLs map[string]string `json:"urls,omitempty"` URLs map[string]string `json:"urls,omitempty"`
Stats *InstanceStats `json:"stats,omitempty"` Stats *InstanceStats `json:"stats,omitempty"`
Languages []string `json:"languages"` Languages []string `json:"languages"`
ContactAccount *Account `json:"account"` ContactAccount *Account `json:"contact_account"`
} }
// InstanceStats hold information for mastodon instance stats. // InstanceStats hold information for mastodon instance stats.

View File

@ -17,7 +17,7 @@ func TestGetInstance(t *testing.T) {
http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError) http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
return 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() defer ts.Close()
@ -47,6 +47,9 @@ func TestGetInstance(t *testing.T) {
if ins.EMail != "mstdn@mstdn.example.com" { if ins.EMail != "mstdn@mstdn.example.com" {
t.Fatalf("want %q but %q", "mstdn@mstdn.example.com", ins.EMail) 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) { func TestGetInstanceMore(t *testing.T) {