Share recent tracks fixture between Last.fm tests

This commit is contained in:
Claudio Ortolina
2026-04-19 07:50:15 +01:00
parent 22a47f4ca9
commit 06ae5f8271
3 changed files with 15 additions and 17 deletions
+2 -6
View File
@@ -1,15 +1,11 @@
defmodule LastFm.TrackTest do
use ExUnit.Case, async: true
@api_response_path Path.expand("../support/fixtures/last_fm/user.getrecenttracks.json", __DIR__)
alias LastFm.Fixtures.RecentTracks
describe "from_api_response/1" do
test "returns correct data" do
api_response =
@api_response_path
|> File.read!()
|> JSON.decode!()
|> get_in(["recenttracks", "track"])
api_response = get_in(RecentTracks.get(), ["recenttracks", "track"])
assert [
%LastFm.Track{