Remove "it" from the test descriptions

This commit is contained in:
Claudio Ortolina
2026-03-27 08:38:41 +00:00
parent b9e3de1db6
commit 1301f888f3
16 changed files with 43 additions and 43 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ defmodule DiscogsTest do
alias Discogs.Fixtures
describe "get_artist/1" do
test "it returns the artist" do
test "returns the artist" do
discogs_id = "discogs_id"
expected_info =
+1 -1
View File
@@ -37,7 +37,7 @@ defmodule LastFm.FeedTest do
}
describe "update and broadcast" do
test "it stores the track and broadcasts the updated track count" do
test "stores the track and broadcasts the updated track count" do
:ok = Feed.subscribe()
assert {:ok, 2} == Feed.update([@track_two, @track_one])
+2 -2
View File
@@ -4,7 +4,7 @@ defmodule LastFmTest do
alias LastFm.{Artist, Fixtures, Scrobble}
describe "get_artist_info/1" do
test "it returns the artist info" do
test "returns the artist info" do
name = "Steven Wilson"
musicbrainz_id = Ecto.UUID.generate()
@@ -22,7 +22,7 @@ defmodule LastFmTest do
end
describe "scrobble/2" do
test "it returns the scrobbled track" do
test "returns the scrobbled track" do
scrobbles = [
%Scrobble{
track: "Wonderland",
+2 -2
View File
@@ -4,7 +4,7 @@ defmodule MusicBrainz.ReleaseTest do
alias MusicBrainz.{Fixtures, Release}
describe "release_duration/1" do
test "it returns the total milliseconds" do
test "returns the total milliseconds" do
release =
Fixtures.Release.release_with_media(:marbles)
|> Release.from_api_response()
@@ -12,7 +12,7 @@ defmodule MusicBrainz.ReleaseTest do
assert Release.release_duration(release) == 5_933_595
end
test "it handles empty durations" do
test "handles empty durations" do
release =
Fixtures.Release.release_with_media(:marbles)
|> put_in(["media", Access.all(), "tracks", Access.all(), "length"], nil)
+2 -2
View File
@@ -7,7 +7,7 @@ defmodule MusicBrainzTest do
alias MusicBrainz.ReleaseGroupSearchResult
describe "search_release_group/2" do
test "it returns results with correct limit and offset" do
test "returns results with correct limit and offset" do
results = release_group_search_results()
expected_results =
@@ -26,7 +26,7 @@ defmodule MusicBrainzTest do
end
describe "search_release_by_barcode/1" do
test "it returns releases belonging to the same release group" do
test "returns releases belonging to the same release group" do
barcode = "5052205070023"
releases =
+3 -3
View File
@@ -6,7 +6,7 @@ defmodule MusicLibrary.ArtistsTest do
alias MusicLibrary.Artists
describe "get_artist/1" do
test "it returns records with essential data" do
test "returns records with essential data" do
record = record()
[expected] = record.artists
@@ -17,7 +17,7 @@ defmodule MusicLibrary.ArtistsTest do
end
describe "get_all_artist_ids/0" do
test "it returns unique artist IDs" do
test "returns unique artist IDs" do
marillion_record = record_with_artist("Marillion")
_another_marillion_record = record_with_artist("Marillion")
steven_wilson_record = record_with_artist("Steven Wilson")
@@ -83,7 +83,7 @@ defmodule MusicLibrary.ArtistsTest do
end
describe "refresh_artist_info/1" do
test "it stores musicbrainz and discogs data" do
test "stores musicbrainz and discogs data" do
steven_wilson_musicbrainz_id = "3a51b862-0144-40f6-aa17-6aaeefea29d9"
Req.Test.stub(MusicBrainz.API, fn conn ->
+1 -1
View File
@@ -4,7 +4,7 @@ defmodule MusicLibrary.Assets.ImageTest do
alias MusicLibrary.Assets.Image
describe "resize/1" do
test "it resizes to the desired size" do
test "resizes to the desired size" do
# Use the cached cover data which is much faster than reading from disk
cover_data = Image.fallback_data()
{:ok, resized_cover} = Image.resize(cover_data)
+1 -1
View File
@@ -97,7 +97,7 @@ defmodule MusicLibrary.Records.RecordTest do
end
describe "add_musicbrainz_data/2" do
test "it updates release_ids and included_release_group_ids" do
test "updates release_ids and included_release_group_ids" do
record = %Record{}
assert record.release_ids == []
assert record.included_release_group_ids == []
+2 -2
View File
@@ -23,11 +23,11 @@ defmodule MusicLibrary.WishlistTest do
assert [%{title: "Brave"}, %{title: "Brave"}] = Wishlist.search_records("brave")
end
test "it respects limit" do
test "respects limit" do
assert [%{title: "Brave"}] = Wishlist.search_records("brave", limit: 1)
end
test "it respects offset" do
test "respects offset" do
[first_match] = Wishlist.search_records("brave", limit: 1)
[second_match] = Wishlist.search_records("brave", limit: 1, offset: 1)
assert first_match !== second_match
@@ -15,13 +15,13 @@ defmodule MusicLibraryWeb.CollectionControllerTest do
describe "GET /api/collection/latest" do
setup [:create_record]
test "it requires authentication", %{conn: conn} do
test "requires authentication", %{conn: conn} do
conn = get(conn, ~p"/api/collection/latest")
assert conn.status == 401
end
test "it returns the latest record", %{conn: conn, record: record} do
test "returns the latest record", %{conn: conn, record: record} do
conn =
conn
|> put_req_header("authorization", "Bearer #{api_token()}")
@@ -34,14 +34,14 @@ defmodule MusicLibraryWeb.CollectionControllerTest do
describe "GET /api/collection/random" do
setup [:create_record]
test "it requires authentication", %{conn: conn} do
test "requires authentication", %{conn: conn} do
conn = get(conn, ~p"/api/collection/random")
assert conn.status == 401
end
# We're not testing random here - the query is solid enough
test "it returns a random record", %{conn: conn, record: record} do
test "returns a random record", %{conn: conn, record: record} do
conn =
conn
|> put_req_header("authorization", "Bearer #{api_token()}")
@@ -54,13 +54,13 @@ defmodule MusicLibraryWeb.CollectionControllerTest do
describe "GET /api/collection" do
setup [:create_record]
test "it requires authentication", %{conn: conn} do
test "requires authentication", %{conn: conn} do
conn = get(conn, ~p"/api/collection")
assert conn.status == 401
end
test "it returns a paginated list of records", %{conn: conn, record: record} do
test "returns a paginated list of records", %{conn: conn, record: record} do
conn =
conn
|> put_req_header("authorization", "Bearer #{api_token()}")
@@ -78,13 +78,13 @@ defmodule MusicLibraryWeb.CollectionControllerTest do
describe "GET /api/collection/on_this_day" do
setup [:create_record]
test "it requires authentication", %{conn: conn} do
test "requires authentication", %{conn: conn} do
conn = get(conn, ~p"/api/collection/on_this_day")
assert conn.status == 401
end
test "it returns a list of records", %{conn: conn, record: record} do
test "returns a list of records", %{conn: conn, record: record} do
conn =
conn
|> put_req_header("authorization", "Bearer #{api_token()}")
@@ -3,7 +3,7 @@ defmodule MusicLibraryWeb.SessionControllerTest do
describe "GET /login" do
@tag :logged_out
test "it shows the login form", %{conn: conn} do
test "shows the login form", %{conn: conn} do
conn = get(conn, "/login")
response = html_response(conn, 200)
@@ -12,7 +12,7 @@ defmodule MusicLibraryWeb.SessionControllerTest do
assert response =~ "Login"
end
test "it resets the session", %{conn: conn} do
test "resets the session", %{conn: conn} do
conn = get(conn, "/login")
session = get_session(conn)
@@ -23,7 +23,7 @@ defmodule MusicLibraryWeb.SessionControllerTest do
describe "POST /sessions/create" do
@tag :logged_out
test "it refuses an invalid password", %{conn: conn} do
test "refuses an invalid password", %{conn: conn} do
conn = post(conn, ~p"/sessions/create", %{"password" => "wrong password"})
{"location", location} =
@@ -39,7 +39,7 @@ defmodule MusicLibraryWeb.SessionControllerTest do
end
@tag :logged_out
test "it accepts a valid password", %{conn: conn} do
test "accepts a valid password", %{conn: conn} do
valid_password =
Application.get_env(:music_library, MusicLibraryWeb)
|> Keyword.fetch!(:login_password)
@@ -26,7 +26,7 @@ defmodule MusicLibraryWeb.ArtistLive.ShowTest do
describe "Show artist" do
setup :fill_collection
test "it shows the artist bio and play count", %{
test "shows the artist bio and play count", %{
conn: conn,
artist_musicbrainz_id: artist_musicbrainz_id
} do
@@ -47,7 +47,7 @@ defmodule MusicLibraryWeb.ArtistLive.ShowTest do
|> assert_has("dt", "Biography")
end
test "it gracefully handles errors in fetching bio and play count", %{
test "gracefully handles errors in fetching bio and play count", %{
conn: conn,
artist_musicbrainz_id: artist_musicbrainz_id
} do
@@ -69,7 +69,7 @@ defmodule MusicLibraryWeb.ArtistLive.ShowTest do
|> assert_has("div", "Error loading biography")
end
test "it shows the artist country and MB id", %{
test "shows the artist country and MB id", %{
conn: conn,
artist_musicbrainz_id: artist_musicbrainz_id
} do
@@ -91,7 +91,7 @@ defmodule MusicLibraryWeb.ArtistLive.ShowTest do
|> assert_has("code", artist_musicbrainz_id)
end
test "it shows records from the collection and the wishlist", %{
test "shows records from the collection and the wishlist", %{
conn: conn,
collection_record: collection_record,
artist_musicbrainz_id: artist_musicbrainz_id
@@ -244,7 +244,7 @@ defmodule MusicLibraryWeb.CollectionLive.IndexTest do
end
describe "Adding a new record" do
test "it shows the import modal", %{conn: conn} do
test "shows the import modal", %{conn: conn} do
conn
|> visit(~p"/collection")
|> click_link("Add")
@@ -253,7 +253,7 @@ defmodule MusicLibraryWeb.CollectionLive.IndexTest do
|> assert_path(~p"/collection/import")
end
test "it imports a record when selected", %{conn: conn} do
test "imports a record when selected", %{conn: conn} do
release_group_search_results = Map.get(release_group_search_results(), "release-groups")
first_release_group_search_result = hd(release_group_search_results)
@@ -343,7 +343,7 @@ defmodule MusicLibraryWeb.CollectionLive.IndexTest do
end
describe "Add via barcode scan" do
test "it tracks the camera status", %{conn: conn} do
test "tracks the camera status", %{conn: conn} do
session =
conn
|> visit(~p"/collection/scan")
@@ -361,7 +361,7 @@ defmodule MusicLibraryWeb.CollectionLive.IndexTest do
|> assert_has("video#camera-preview")
end
test "it adds a record after scanning", %{conn: conn} do
test "adds a record after scanning", %{conn: conn} do
barcode = "5037300650128"
releases = releases(:marbles)
@@ -28,7 +28,7 @@ defmodule MusicLibraryWeb.CollectionLive.ShowTest do
end
describe "Show record" do
test "it includes all needed information", %{conn: conn} do
test "includes all needed information", %{conn: conn} do
record = record()
transform = %Transform{hash: record.cover_hash, width: nil}
payload = Transform.encode!(transform)
@@ -28,7 +28,7 @@ defmodule MusicLibraryWeb.StatsLive.IndexTest do
describe "Stats home page" do
setup [:fill_collection, :fill_wishlist]
test "it shows the collection counts (total, format, and type)", %{
test "shows the collection counts (total, format, and type)", %{
conn: conn,
collection: collection
} do
@@ -52,7 +52,7 @@ defmodule MusicLibraryWeb.StatsLive.IndexTest do
end)
end
test "it shows the latest purchase", %{conn: conn, collection: collection} do
test "shows the latest purchase", %{conn: conn, collection: collection} do
latest_record = List.last(collection)
session =
@@ -65,13 +65,13 @@ defmodule MusicLibraryWeb.StatsLive.IndexTest do
end
end
test "it shows the wishlist total count", %{conn: conn, wishlist: wishlist} do
test "shows the wishlist total count", %{conn: conn, wishlist: wishlist} do
conn
|> visit("/")
|> assert_has("dd", wishlist |> length() |> Integer.to_string())
end
test "it displays records for the current date in the 'On This Day' section", %{
test "displays records for the current date in the 'On This Day' section", %{
conn: conn,
collection: collection
} do
@@ -103,7 +103,7 @@ defmodule MusicLibraryWeb.StatsLive.IndexTest do
refute_has(session, "##{record_yesterday.id} h2", escape(record_yesterday.title))
end
test "it updates the 'On This Day' records when the date is changed", %{
test "updates the 'On This Day' records when the date is changed", %{
conn: conn,
collection: collection
} do
@@ -146,7 +146,7 @@ defmodule MusicLibraryWeb.StatsLive.IndexTest do
end
describe "Scrobble activity" do
test "it shows the scrobble activity", %{conn: conn} do
test "shows the scrobble activity", %{conn: conn} do
# In test we don't run the LastFm.Refresh worker,
# so we need to interact directly with the LastFm.Feed to have some data
#
@@ -20,7 +20,7 @@ defmodule MusicLibraryWeb.WishlistLive.ShowTest do
end
describe "Show record" do
test "it includes all needed information", %{conn: conn} do
test "includes all needed information", %{conn: conn} do
record = record(purchased_at: nil)
transform = %Transform{hash: record.cover_hash, width: nil}
payload = Transform.encode!(transform)