Add Articles
mix phx.gen.live Articles Article articles title:string\ /Crucial/git/phoenix-liveview-book content:text url:string language:string\ date:utc_datetime author_id:references:authors
This commit is contained in:
24
test/support/fixtures/articles_fixtures.ex
Normal file
24
test/support/fixtures/articles_fixtures.ex
Normal file
@ -0,0 +1,24 @@
|
||||
defmodule Outlook.ArticlesFixtures do
|
||||
@moduledoc """
|
||||
This module defines test helpers for creating
|
||||
entities via the `Outlook.Articles` context.
|
||||
"""
|
||||
|
||||
@doc """
|
||||
Generate a article.
|
||||
"""
|
||||
def article_fixture(attrs \\ %{}) do
|
||||
{:ok, article} =
|
||||
attrs
|
||||
|> Enum.into(%{
|
||||
content: "some content",
|
||||
date: ~U[2022-12-25 16:16:00Z],
|
||||
language: "some language",
|
||||
title: "some title",
|
||||
url: "some url"
|
||||
})
|
||||
|> Outlook.Articles.create_article()
|
||||
|
||||
article
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user