Update
This commit is contained in:
parent
f90a7133bc
commit
00ecbadeca
29 changed files with 871 additions and 12 deletions
24
test/support/fixtures/announces_fixtures.ex
Normal file
24
test/support/fixtures/announces_fixtures.ex
Normal file
|
@ -0,0 +1,24 @@
|
|||
defmodule Nulla.AnnouncesFixtures do
|
||||
import Nulla.ActorsFixtures
|
||||
import Nulla.NotesFixtures
|
||||
|
||||
@moduledoc """
|
||||
This module defines test helpers for creating
|
||||
entities via the `Nulla.Announces` context.
|
||||
"""
|
||||
|
||||
@doc """
|
||||
Generate a announce.
|
||||
"""
|
||||
def announce_fixture(attrs \\ %{}) do
|
||||
actor = actor_fixture()
|
||||
note = note_fixture()
|
||||
|
||||
{:ok, announce} =
|
||||
attrs
|
||||
|> Enum.into(%{actor_id: actor.id, note_id: note.id})
|
||||
|> Nulla.Announces.create_announce()
|
||||
|
||||
announce
|
||||
end
|
||||
end
|
24
test/support/fixtures/likes_fixtures.ex
Normal file
24
test/support/fixtures/likes_fixtures.ex
Normal file
|
@ -0,0 +1,24 @@
|
|||
defmodule Nulla.LikesFixtures do
|
||||
import Nulla.ActorsFixtures
|
||||
import Nulla.NotesFixtures
|
||||
|
||||
@moduledoc """
|
||||
This module defines test helpers for creating
|
||||
entities via the `Nulla.Likes` context.
|
||||
"""
|
||||
|
||||
@doc """
|
||||
Generate a like.
|
||||
"""
|
||||
def like_fixture(attrs \\ %{}) do
|
||||
actor = actor_fixture()
|
||||
note = note_fixture()
|
||||
|
||||
{:ok, like} =
|
||||
attrs
|
||||
|> Enum.into(%{actor_id: actor.id, note_id: note.id})
|
||||
|> Nulla.Likes.create_like()
|
||||
|
||||
like
|
||||
end
|
||||
end
|
|
@ -22,6 +22,7 @@ defmodule Nulla.NotesFixtures do
|
|||
published: ~U[2025-07-01 09:17:00Z],
|
||||
sensitive: true,
|
||||
to: ["option1", "option2"],
|
||||
tag: [%{"key1" => "value1"}, %{"key2" => "value2"}],
|
||||
url: "some url",
|
||||
visibility: "some visibility",
|
||||
actor_id: actor.id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue