22 lines
408 B
Elixir
22 lines
408 B
Elixir
defmodule Prototype.ContentFixtures do
|
|
@moduledoc """
|
|
This module defines test helpers for creating
|
|
entities via the `Prototype.Content` context.
|
|
"""
|
|
|
|
@doc """
|
|
Generate a post.
|
|
"""
|
|
def post_fixture(attrs \\ %{}) do
|
|
{:ok, post} =
|
|
attrs
|
|
|> Enum.into(%{
|
|
body: "some body",
|
|
title: "some title"
|
|
})
|
|
|> Prototype.Content.create_post()
|
|
|
|
post
|
|
end
|
|
end
|