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:
@@ -26,8 +26,9 @@ defmodule MusicLibrary.AssetsTest do
|
|||||||
properties: %{"language" => "english"}
|
properties: %{"language" => "english"}
|
||||||
}
|
}
|
||||||
|
|
||||||
assert {:ok, _} = Assets.store(params)
|
assert {:ok, first} = Assets.store(params)
|
||||||
assert {:ok, _} = Assets.store(params)
|
assert {:ok, second} = Assets.store(params)
|
||||||
|
assert second.hash == first.hash
|
||||||
|
|
||||||
assert 1 = Repo.aggregate(Assets.Asset, :count, :hash)
|
assert 1 = Repo.aggregate(Assets.Asset, :count, :hash)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user