Fix contact_account
This commit is contained in:
parent
1b7f743892
commit
ef1332c96b
|
@ -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.
|
||||||
|
|
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user