Update the links fixture to use the factory.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user