|
|
@ -4,21 +4,12 @@ defmodule LinkShortener.LinksFixtures do
|
|
|
|
entities via the `LinkShortener.Links` context.
|
|
|
|
entities via the `LinkShortener.Links` context.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
alias LinkShortener.Links
|
|
|
|
alias LinkShortener.Factories.LinkFactory
|
|
|
|
|
|
|
|
|
|
|
|
@doc """
|
|
|
|
@doc """
|
|
|
|
Generate a link.
|
|
|
|
Generate a link.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
def link_fixture(attrs \\ %{}) do
|
|
|
|
def link_fixture(attrs \\ %{}) do
|
|
|
|
{:ok, link} =
|
|
|
|
LinkFactory.create_link(attrs)
|
|
|
|
attrs
|
|
|
|
|
|
|
|
|> Enum.into(%{
|
|
|
|
|
|
|
|
name: "some name",
|
|
|
|
|
|
|
|
url: "https://gitlab.com/KKlochko/link_shortener",
|
|
|
|
|
|
|
|
shorten: "api-article",
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|> Links.create_one()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
link
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|