Extend Last.fm Feed album/artist functions
This commit is contained in:
@@ -49,12 +49,28 @@ defmodule LastFm.FeedTest do
|
||||
|
||||
test "it returns artists in descending order of scrobble" do
|
||||
:ok = Feed.update([@track_two, @track_one])
|
||||
assert [@track_one.artist] == Feed.all_artists()
|
||||
|
||||
assert [
|
||||
%{
|
||||
artist: @track_two.artist,
|
||||
scrobbled_at_uts: @track_two.scrobbled_at_uts,
|
||||
scrobbled_at_label: @track_two.scrobbled_at_label
|
||||
}
|
||||
] ==
|
||||
Feed.all_artists()
|
||||
end
|
||||
|
||||
test "it returns albums in descending order of scrobble" do
|
||||
:ok = Feed.update([@track_two, @track_one])
|
||||
assert [@track_one.album] == Feed.all_albums()
|
||||
|
||||
assert [
|
||||
%{
|
||||
album: @track_two.album,
|
||||
cover_url: @track_two.cover_url,
|
||||
scrobbled_at_uts: @track_two.scrobbled_at_uts,
|
||||
scrobbled_at_label: @track_two.scrobbled_at_label
|
||||
}
|
||||
] == Feed.all_albums()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user