memEx/test/support/fixtures/steps_fixtures.ex

23 lines
470 B
Elixir
Raw Normal View History

2022-07-25 20:18:39 -04:00
defmodule Memex.StepsFixtures do
@moduledoc """
This module defines test helpers for creating
entities via the `Memex.Steps` context.
"""
2022-11-24 15:35:29 -05:00
alias Memex.Pipelines.Steps
2022-07-25 20:18:39 -04:00
@doc """
Generate a step.
"""
2022-11-24 15:35:29 -05:00
def step_fixture(attrs \\ %{}, position, pipeline, user) do
2022-07-25 20:18:39 -04:00
{:ok, step} =
attrs
|> Enum.into(%{
2022-11-24 15:35:29 -05:00
content: "some content",
2022-07-25 20:18:39 -04:00
title: "some title"
})
2022-11-24 15:35:29 -05:00
|> Steps.create_step(position, pipeline, user)
2022-07-25 20:18:39 -04:00
step
end
end