mirror of
https://github.com/philomena-dev/philomena.git
synced 2025-02-07 23:06:42 +01:00
24 lines
491 B
Elixir
24 lines
491 B
Elixir
|
defmodule Philomena.ChannelsFixtures do
|
||
|
@moduledoc """
|
||
|
This module defines test helpers for creating entities via the `Philomena.Channels` context.
|
||
|
"""
|
||
|
|
||
|
alias Philomena.Channels
|
||
|
|
||
|
def unique_name, do: "channel#{System.unique_integer()}"
|
||
|
|
||
|
def channel_fixture(attrs \\ %{}) do
|
||
|
name = unique_name()
|
||
|
|
||
|
{:ok, channel} =
|
||
|
attrs
|
||
|
|> Enum.into(%{
|
||
|
short_name: name,
|
||
|
type: "PicartoChannel"
|
||
|
})
|
||
|
|> Channels.create_channel()
|
||
|
|
||
|
channel
|
||
|
end
|
||
|
end
|