commit
0d8819ecaf
2
apps.go
2
apps.go
|
@ -27,7 +27,7 @@ type AppConfig struct {
|
||||||
|
|
||||||
// Application is mastodon application.
|
// Application is mastodon application.
|
||||||
type Application struct {
|
type Application struct {
|
||||||
ID int64 `json:"id"`
|
ID ID `json:"id"`
|
||||||
RedirectURI string `json:"redirect_uri"`
|
RedirectURI string `json:"redirect_uri"`
|
||||||
ClientID string `json:"client_id"`
|
ClientID string `json:"client_id"`
|
||||||
ClientSecret string `json:"client_secret"`
|
ClientSecret string `json:"client_secret"`
|
||||||
|
|
|
@ -26,7 +26,7 @@ func TestRegisterApp(t *testing.T) {
|
||||||
fmt.Fprintln(w, `<html><head><title>Apps</title></head></html>`)
|
fmt.Fprintln(w, `<html><head><title>Apps</title></head></html>`)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
fmt.Fprintln(w, `{"client_id": "foo", "client_secret": "bar"}`)
|
fmt.Fprintln(w, `{"id": 123, "client_id": "foo", "client_secret": "bar"}`)
|
||||||
return
|
return
|
||||||
}))
|
}))
|
||||||
defer ts.Close()
|
defer ts.Close()
|
||||||
|
@ -64,6 +64,9 @@ func TestRegisterApp(t *testing.T) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("should not be fail: %v", err)
|
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" {
|
if app.ClientID != "foo" {
|
||||||
t.Fatalf("want %q but %q", "foo", app.ClientID)
|
t.Fatalf("want %q but %q", "foo", app.ClientID)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user