Fix incorrect tests
This commit is contained in:
@@ -290,7 +290,7 @@ defmodule MusicLibrary.CollectionTest do
|
|||||||
test "returns a random record", %{collection: collection} do
|
test "returns a random record", %{collection: collection} do
|
||||||
# NOTE: we can't control randomness in the test, because the `RANDOM()` function
|
# NOTE: we can't control randomness in the test, because the `RANDOM()` function
|
||||||
# in SQLite doesn't support a seed.
|
# in SQLite doesn't support a seed.
|
||||||
random_record = Collection.get_latest_record!()
|
random_record = Collection.get_random_record!()
|
||||||
collection_ids = Enum.map(collection, & &1.id)
|
collection_ids = Enum.map(collection, & &1.id)
|
||||||
|
|
||||||
assert random_record.id in collection_ids
|
assert random_record.id in collection_ids
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ defmodule MusicLibraryWeb.CollectionControllerTest do
|
|||||||
setup [:create_record]
|
setup [:create_record]
|
||||||
|
|
||||||
test "it requires authentication", %{conn: conn} do
|
test "it requires authentication", %{conn: conn} do
|
||||||
conn = get(conn, ~p"/api/collection/latest")
|
conn = get(conn, ~p"/api/collection/random")
|
||||||
|
|
||||||
assert conn.status == 401
|
assert conn.status == 401
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user