From 9b2f9aaa8c60f39c660fa3e00397ba8ce3aa8ba1 Mon Sep 17 00:00:00 2001 From: KKlochko Date: Sun, 1 Sep 2024 21:30:06 +0300 Subject: [PATCH] Update the links fixture to use the factory. --- test/support/fixtures/links_fixtures.ex | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/test/support/fixtures/links_fixtures.ex b/test/support/fixtures/links_fixtures.ex index 115ab82..4408c69 100644 --- a/test/support/fixtures/links_fixtures.ex +++ b/test/support/fixtures/links_fixtures.ex @@ -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