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
@@ -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)