defmodule Outlook.PublicFixtures do
  @moduledoc """
  This module defines test helpers for creating
  entities via the `Outlook.Public` context.
  """

  # TODO: make this work

  @doc """
  Generate an artikel.
  """
  def artikel_fixture(attrs \\ %{}) do
    {:ok, artikel} =
      attrs
      |> Enum.into(%{
        date: "some date",
        public_content: "some public_content",
        teaser: "some teaser",
        title: "some title",
        translator: "some translator",
        unauthorized: true
      })
      |> Outlook.Public.create_artikel()

    artikel
  end

  @doc """
  Generate an autor.
  """
  def autor_fixture(attrs \\ %{}) do
    {:ok, autor} =
      attrs
      |> Enum.into(%{
        description: "some description",
        homepage_name: "some homepage_name",
        homepage_url: "some homepage_url",
        name: "some name"
      })
      |> Outlook.Public.create_autor()

    autor
  end

end
