Pin asset dedup assertion to same-hash

The duplicate prevention test asserted `{:ok, _}` twice without checking
that both calls returned the same asset. Assert hash equality.

Refs #176
This commit is contained in:
Claudio Ortolina
2026-04-19 22:44:13 +01:00
parent ae036e79fb
commit e0fe5051ec
+3 -2
View File
@@ -26,8 +26,9 @@ defmodule MusicLibrary.AssetsTest do
properties: %{"language" => "english"}
}
assert {:ok, _} = Assets.store(params)
assert {:ok, _} = Assets.store(params)
assert {:ok, first} = Assets.store(params)
assert {:ok, second} = Assets.store(params)
assert second.hash == first.hash
assert 1 = Repo.aggregate(Assets.Asset, :count, :hash)
end