diff --git a/test/last_fm/artist_test.exs b/test/last_fm/artist_test.exs index deb5cd1c..69daf528 100644 --- a/test/last_fm/artist_test.exs +++ b/test/last_fm/artist_test.exs @@ -1,7 +1,7 @@ defmodule LastFm.ArtistTest do use ExUnit.Case, async: true - @api_response_path Path.expand("../support/fixtures/artist.getinfo.json", __DIR__) + @api_response_path Path.expand("../support/fixtures/last_fm/artist.getinfo.json", __DIR__) describe "from_api_response/1" do test "returns correct data" do diff --git a/test/last_fm/track_test.exs b/test/last_fm/track_test.exs index b915181f..01bbb9d2 100644 --- a/test/last_fm/track_test.exs +++ b/test/last_fm/track_test.exs @@ -1,7 +1,7 @@ defmodule LastFm.TrackTest do use ExUnit.Case, async: true - @api_response_path Path.expand("../support/fixtures/user.getrecenttracks.json", __DIR__) + @api_response_path Path.expand("../support/fixtures/last_fm/user.getrecenttracks.json", __DIR__) describe "from_api_response/1" do test "returns correct data" do diff --git a/test/music_library/artists_test.exs b/test/music_library/artists_test.exs index f8060480..f80bf661 100644 --- a/test/music_library/artists_test.exs +++ b/test/music_library/artists_test.exs @@ -4,7 +4,7 @@ defmodule MusicLibrary.ArtistsTest do alias MusicLibrary.Artists alias LastFm.APIBehaviourMock import MusicLibrary.RecordsFixtures - import LastFm.Fixtures + import LastFm.Fixtures.Artist import Mox setup :verify_on_exit! @@ -46,7 +46,7 @@ defmodule MusicLibrary.ArtistsTest do [artist] = collection_record.artists artist_musicbrainz_id = artist.musicbrainz_id - expected_info = artist_get_info() + expected_info = get_info() expect(APIBehaviourMock, :get_artist_info, fn {:musicbrainz_id, ^artist_musicbrainz_id}, _config -> diff --git a/test/music_library_web/live/artist_live/show_test.exs b/test/music_library_web/live/artist_live/show_test.exs index 86ca8e5c..d127646e 100644 --- a/test/music_library_web/live/artist_live/show_test.exs +++ b/test/music_library_web/live/artist_live/show_test.exs @@ -2,7 +2,7 @@ defmodule MusicLibraryWeb.ArtistLive.ShowTest do use MusicLibraryWeb.ConnCase import MusicLibrary.RecordsFixtures - import LastFm.Fixtures + import LastFm.Fixtures.Artist import Mox alias LastFm.APIBehaviourMock @@ -30,7 +30,7 @@ defmodule MusicLibraryWeb.ArtistLive.ShowTest do } do expect(APIBehaviourMock, :get_artist_info, fn {:musicbrainz_id, ^artist_musicbrainz_id}, _config -> - {:ok, artist_get_info()} + {:ok, get_info()} end) conn diff --git a/test/support/fixtures/last_fm_fixtures.ex b/test/support/fixtures/last_fm/artist.ex similarity index 79% rename from test/support/fixtures/last_fm_fixtures.ex rename to test/support/fixtures/last_fm/artist.ex index d1f2b61a..cee00a3f 100644 --- a/test/support/fixtures/last_fm_fixtures.ex +++ b/test/support/fixtures/last_fm/artist.ex @@ -1,9 +1,9 @@ -defmodule LastFm.Fixtures do - @fixtures_folder Path.join([File.cwd!(), "test/support/fixtures"]) +defmodule LastFm.Fixtures.Artist do + @fixtures_folder Path.join([File.cwd!(), "test/support/fixtures/last_fm"]) alias LastFm.Artist - def artist_get_info do + def get_info do Path.join([@fixtures_folder, "artist.getinfo.json"]) |> File.read!() |> JSON.decode!() diff --git a/test/support/fixtures/artist.getinfo.json b/test/support/fixtures/last_fm/artist.getinfo.json similarity index 100% rename from test/support/fixtures/artist.getinfo.json rename to test/support/fixtures/last_fm/artist.getinfo.json diff --git a/test/support/fixtures/artist.getsimilarartists.json b/test/support/fixtures/last_fm/artist.getsimilarartists.json.json similarity index 100% rename from test/support/fixtures/artist.getsimilarartists.json rename to test/support/fixtures/last_fm/artist.getsimilarartists.json.json diff --git a/test/support/fixtures/user.getrecenttracks.json b/test/support/fixtures/last_fm/user.getrecenttracks.json similarity index 100% rename from test/support/fixtures/user.getrecenttracks.json rename to test/support/fixtures/last_fm/user.getrecenttracks.json