Update the links fixture to use the factory.

This commit is contained in:
2024-09-01 21:30:06 +03:00
parent 83bf6ce558
commit 9b2f9aaa8c
+2 -11
View File
@@ -4,21 +4,12 @@ defmodule LinkShortener.LinksFixtures do
entities via the `LinkShortener.Links` context.
"""
alias LinkShortener.Links
alias LinkShortener.Factories.LinkFactory
@doc """
Generate a link.
"""
def link_fixture(attrs \\ %{}) do
{:ok, link} =
attrs
|> Enum.into(%{
name: "some name",
url: "https://gitlab.com/KKlochko/link_shortener",
shorten: "api-article",
})
|> Links.create_one()
link
LinkFactory.create_link(attrs)
end
end