Add Authors
mix phx.gen.live Authors Author authors name:string description:text homepage_name:string homepage_url:string
This commit is contained in:
23
test/support/fixtures/authors_fixtures.ex
Normal file
23
test/support/fixtures/authors_fixtures.ex
Normal file
@ -0,0 +1,23 @@
|
||||
defmodule Outlook.AuthorsFixtures do
|
||||
@moduledoc """
|
||||
This module defines test helpers for creating
|
||||
entities via the `Outlook.Authors` context.
|
||||
"""
|
||||
|
||||
@doc """
|
||||
Generate a author.
|
||||
"""
|
||||
def author_fixture(attrs \\ %{}) do
|
||||
{:ok, author} =
|
||||
attrs
|
||||
|> Enum.into(%{
|
||||
description: "some description",
|
||||
homepage_name: "some homepage_name",
|
||||
homepage_url: "some homepage_url",
|
||||
name: "some name"
|
||||
})
|
||||
|> Outlook.Authors.create_author()
|
||||
|
||||
author
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user