Fix route tests
This commit is contained in:
parent
034c4e1088
commit
f7132c06fc
1 changed files with 4 additions and 4 deletions
|
@ -36,13 +36,13 @@ func TestGetArtistByIDRoute(t *testing.T) {
|
|||
// Dynamic data is hard to test so here we validate JSON response
|
||||
// And we check known fields which are not likely to change
|
||||
// We then check that the DB was updated correctly just to be sure
|
||||
var spotifyResp SpotifyResponse
|
||||
err := json.NewDecoder(w.Body).Decode(&spotifyResp)
|
||||
var resp ArtistProfile
|
||||
err := json.NewDecoder(w.Body).Decode(&resp)
|
||||
if err != nil {
|
||||
assert.Fail(t, fmt.Sprintf("Could not validate and parse JSON response into SpotifyResponse struct: %s", err.Error()))
|
||||
}
|
||||
assert.Equal(t, "0TnOYISbd1XYRBk9myaseg", spotifyResp.ID)
|
||||
assert.Equal(t, "Pitbull", spotifyResp.Name)
|
||||
assert.Equal(t, "0TnOYISbd1XYRBk9myaseg", resp.SpotifyID)
|
||||
assert.Equal(t, "Pitbull", resp.Name)
|
||||
|
||||
var artist ArtistProfile
|
||||
dbResult := env.db.Take(&artist)
|
||||
|
|
Loading…
Add table
Reference in a new issue