projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix typo: s/"tags"/"tag"/g
[akkoma]
/
test
/
support
/
factory.ex
diff --git
a/test/support/factory.ex
b/test/support/factory.ex
index af38be46c68bedb31ac98f1ef7a03aec14e4f134..90c7d80f2d607111a50fe441bfcbc31f40ed744f 100644
(file)
--- a/
test/support/factory.ex
+++ b/
test/support/factory.ex
@@
-5,6
+5,17
@@
defmodule Pleroma.Factory do
use ExMachina.Ecto, repo: Pleroma.Repo
defmodule Pleroma.Factory do
use ExMachina.Ecto, repo: Pleroma.Repo
+ def participation_factory do
+ conversation = insert(:conversation)
+ user = insert(:user)
+
+ %Pleroma.Conversation.Participation{
+ conversation: conversation,
+ user: user,
+ read: false
+ }
+ end
+
def conversation_factory do
%Pleroma.Conversation{
ap_id: sequence(:ap_id, &"https://some_conversation/#{&1}")
def conversation_factory do
%Pleroma.Conversation{
ap_id: sequence(:ap_id, &"https://some_conversation/#{&1}")
@@
-32,7
+43,7
@@
defmodule Pleroma.Factory do
def note_factory(attrs \\ %{}) do
text = sequence(:text, &"This is :moominmamma: note #{&1}")
def note_factory(attrs \\ %{}) do
text = sequence(:text, &"This is :moominmamma: note #{&1}")
- user = insert(:user)
+ user =
attrs[:user] ||
insert(:user)
data = %{
"type" => "Note",
data = %{
"type" => "Note",
@@
-102,7
+113,8
@@
defmodule Pleroma.Factory do
end
def note_activity_factory(attrs \\ %{}) do
end
def note_activity_factory(attrs \\ %{}) do
- note = attrs[:note] || insert(:note)
+ user = attrs[:user] || insert(:user)
+ note = attrs[:note] || insert(:note, user: user)
data = %{
"id" => Pleroma.Web.ActivityPub.Utils.generate_activity_id(),
data = %{
"id" => Pleroma.Web.ActivityPub.Utils.generate_activity_id(),