Add Translations

mix phx.gen.live Translations Translation translations \
  lang:string title:string teaser:text content:map \
  date:utc_datetime user_id:references:users \
  public:boolean unauthorized:boolean article_id:references:articles
This commit is contained in:
Thelonius Kort
2022-12-26 18:45:40 +01:00
parent f7f1e1a284
commit f66521dba8
13 changed files with 600 additions and 0 deletions

View File

@ -0,0 +1,26 @@
defmodule Outlook.TranslationsFixtures do
@moduledoc """
This module defines test helpers for creating
entities via the `Outlook.Translations` context.
"""
@doc """
Generate a translation.
"""
def translation_fixture(attrs \\ %{}) do
{:ok, translation} =
attrs
|> Enum.into(%{
content: %{},
date: ~U[2022-12-25 17:13:00Z],
lang: "some lang",
public: true,
teaser: "some teaser",
title: "some title",
unauthorized: true
})
|> Outlook.Translations.create_translation()
translation
end
end