The first public release of Fabled Minstrel #158
@@ -251,9 +251,15 @@ func TestGetRandomSongs_NarrowsByGenreAndYear(t *testing.T) {
|
|||||||
|
|
||||||
func (f picksFixture) similar(t *testing.T, method func(http.ResponseWriter, *http.Request), key, id string) ([]string, int) {
|
func (f picksFixture) similar(t *testing.T, method func(http.ResponseWriter, *http.Request), key, id string) ([]string, int) {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
var got map[string]SimilarSongsContainer
|
var got struct {
|
||||||
|
SimilarSongs SimilarSongsContainer `json:"similarSongs"`
|
||||||
|
SimilarSongs2 SimilarSongsContainer `json:"similarSongs2"`
|
||||||
|
}
|
||||||
code := call(t, method, f.user, "count=10&id="+id, &got)
|
code := call(t, method, f.user, "count=10&id="+id, &got)
|
||||||
return titles(got[key].Songs), code
|
if key == "similarSongs2" {
|
||||||
|
return titles(got.SimilarSongs2.Songs), code
|
||||||
|
}
|
||||||
|
return titles(got.SimilarSongs.Songs), code
|
||||||
}
|
}
|
||||||
|
|
||||||
// Radio from a song, an album or an artist: every pick is playable, and the
|
// Radio from a song, an album or an artist: every pick is playable, and the
|
||||||
|
|||||||
Reference in New Issue
Block a user