Rename record_fixture* to record*
This commit is contained in:
@@ -4,7 +4,7 @@ defmodule MusicLibraryWeb.CollectionControllerTest do
|
||||
import MusicLibrary.RecordsFixtures
|
||||
|
||||
defp create_record(_) do
|
||||
%{record: record_fixture_with_artist("Steven Wilson")}
|
||||
%{record: record_with_artist("Steven Wilson")}
|
||||
end
|
||||
|
||||
defp api_token do
|
||||
|
||||
@@ -5,7 +5,7 @@ defmodule MusicLibraryWeb.CoverControllerTest do
|
||||
alias MusicLibrary.Records.Cover
|
||||
|
||||
defp create_record(_) do
|
||||
%{record: record_fixture()}
|
||||
%{record: record()}
|
||||
end
|
||||
|
||||
describe "GET /covers/:record_id" do
|
||||
|
||||
@@ -17,7 +17,7 @@ defmodule MusicLibraryWeb.ArtistLive.ShowTest do
|
||||
|
||||
defp fill_collection(_config) do
|
||||
collection_record =
|
||||
record_fixture_with_artist("Steven Wilson", %{
|
||||
record_with_artist("Steven Wilson", %{
|
||||
title: "The Raven that refused to sing",
|
||||
purchased_at: DateTime.utc_now()
|
||||
})
|
||||
@@ -74,13 +74,13 @@ defmodule MusicLibraryWeb.ArtistLive.ShowTest do
|
||||
artist_musicbrainz_id: artist_musicbrainz_id
|
||||
} do
|
||||
wishlist_record =
|
||||
record_fixture_with_artist("Steven Wilson", %{
|
||||
record_with_artist("Steven Wilson", %{
|
||||
title: "Grace for drowning",
|
||||
purchased_at: nil
|
||||
})
|
||||
|
||||
other_collection_record =
|
||||
record_fixture_with_artist("Porcupine Tree", %{purchased_at: DateTime.utc_now()})
|
||||
record_with_artist("Porcupine Tree", %{purchased_at: DateTime.utc_now()})
|
||||
|
||||
# for this test, we don't care about the artist info, but we mock it to avoid false test failures
|
||||
expect(APIBehaviourMock, :get_artist_info, fn {:musicbrainz_id, ^artist_musicbrainz_id},
|
||||
|
||||
@@ -13,12 +13,12 @@ defmodule MusicLibraryWeb.CollectionLive.IndexTest do
|
||||
@total_records @default_records_page_size + 10
|
||||
|
||||
defp fill_collection(_) do
|
||||
records = Enum.map(1..@total_records, fn _ -> record_fixture() end)
|
||||
records = Enum.map(1..@total_records, fn _ -> record() end)
|
||||
%{collection: records}
|
||||
end
|
||||
|
||||
defp fill_wishlist(_) do
|
||||
records = Enum.map(1..@total_records, fn _ -> record_fixture(%{purchased_at: nil}) end)
|
||||
records = Enum.map(1..@total_records, fn _ -> record(%{purchased_at: nil}) end)
|
||||
%{wishlist: records}
|
||||
end
|
||||
|
||||
@@ -216,7 +216,7 @@ defmodule MusicLibraryWeb.CollectionLive.IndexTest do
|
||||
|
||||
describe "Updating record metadata" do
|
||||
test "can navigate to the record edit form", %{conn: conn} do
|
||||
record = record_fixture()
|
||||
record = record()
|
||||
|
||||
conn
|
||||
|> visit(~p"/collection")
|
||||
@@ -226,7 +226,7 @@ defmodule MusicLibraryWeb.CollectionLive.IndexTest do
|
||||
end
|
||||
|
||||
test "can change the record cover", %{conn: conn} do
|
||||
record = record_fixture(cover_data: File.read!(marbles_cover_fixture()))
|
||||
record = record(cover_data: File.read!(marbles_cover_fixture()))
|
||||
session = visit(conn, ~p"/collection/#{record.id}/edit")
|
||||
|
||||
session
|
||||
|
||||
@@ -12,7 +12,7 @@ defmodule MusicLibraryWeb.CollectionLive.ShowTest do
|
||||
|
||||
describe "Edit record from show page" do
|
||||
test "can navigate to the record edit form", %{conn: conn} do
|
||||
record = record_fixture()
|
||||
record = record()
|
||||
|
||||
conn
|
||||
|> visit(~p"/collection/#{record.id}")
|
||||
@@ -24,7 +24,7 @@ defmodule MusicLibraryWeb.CollectionLive.ShowTest do
|
||||
|
||||
describe "Show record" do
|
||||
test "it includes all needed information", %{conn: conn} do
|
||||
record = record_fixture()
|
||||
record = record()
|
||||
|
||||
session =
|
||||
conn
|
||||
|
||||
@@ -11,12 +11,12 @@ defmodule MusicLibraryWeb.StatsLive.IndexTest do
|
||||
setup :verify_on_exit!
|
||||
|
||||
defp fill_collection(_) do
|
||||
records = Enum.map(1..19, fn _ -> record_fixture() end)
|
||||
records = Enum.map(1..19, fn _ -> record() end)
|
||||
%{collection: records}
|
||||
end
|
||||
|
||||
defp fill_wishlist(_) do
|
||||
records = Enum.map(1..21, fn _ -> record_fixture(%{purchased_at: nil}) end)
|
||||
records = Enum.map(1..21, fn _ -> record(%{purchased_at: nil}) end)
|
||||
%{wishlist: records}
|
||||
end
|
||||
|
||||
@@ -160,12 +160,12 @@ defmodule MusicLibraryWeb.StatsLive.IndexTest do
|
||||
# their status in the scrobble activity changes.
|
||||
|
||||
_machinarium_soundtrack =
|
||||
record_fixture(purchased_at: nil)
|
||||
record(purchased_at: nil)
|
||||
|> Records.change_record(%{release_ids: ["4bad26f6-1b27-4554-93bd-40b91ed7866c"]})
|
||||
|> Repo.update!()
|
||||
|
||||
_the_last_flight =
|
||||
record_fixture(purchased_at: DateTime.utc_now())
|
||||
record(purchased_at: DateTime.utc_now())
|
||||
|> Records.change_record(%{release_ids: ["2157367e-bf73-48bb-8185-41023a54fa08"]})
|
||||
|> Repo.update!()
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ defmodule MusicLibraryWeb.WishlistLive.IndexTest do
|
||||
import MusicLibrary.RecordsFixtures
|
||||
|
||||
defp fill_wishlist(_) do
|
||||
records = Enum.map(1..5, fn _ -> record_fixture(%{purchased_at: nil}) end)
|
||||
records = Enum.map(1..5, fn _ -> record(%{purchased_at: nil}) end)
|
||||
%{wishlist: records}
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user