Fix tests, add trophies endpoint for account, edit trophies struct

Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
This commit is contained in:
Vartan Benohanian
2020-06-27 23:15:27 -04:00
parent cad26daa3b
commit c8d7abf216
8 changed files with 114 additions and 73 deletions
+16
View File
@@ -167,3 +167,19 @@ func TestAccountServiceOp_UpdateSettings(t *testing.T) {
assert.NoError(t, err)
assert.Equal(t, expectedSettings, settings)
}
func TestAccountService_Trophies(t *testing.T) {
setup()
defer teardown()
blob := readFileContents(t, "testdata/account/trophies.json")
mux.HandleFunc("/api/v1/me/trophies", func(w http.ResponseWriter, r *http.Request) {
assert.Equal(t, http.MethodGet, r.Method)
fmt.Fprint(w, blob)
})
trophies, _, err := client.Account.Trophies(ctx)
assert.NoError(t, err)
assert.Equal(t, expectedTrophies, trophies)
}