Update the links fixture to use the factory.

dev
KKlochko 8 months ago
parent 83bf6ce558
commit 9b2f9aaa8c

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

Loading…
Cancel
Save