aboutsummaryrefslogtreecommitdiff
path: root/test/support/factory.ex
diff options
context:
space:
mode:
Diffstat (limited to 'test/support/factory.ex')
-rw-r--r--test/support/factory.ex12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/support/factory.ex b/test/support/factory.ex
index 5f976f9ce..314f26ec9 100644
--- a/test/support/factory.ex
+++ b/test/support/factory.ex
@@ -43,6 +43,18 @@ defmodule Pleroma.Factory do
}
end
+ def user_relationship_factory(attrs \\ %{}) do
+ source = attrs[:source] || insert(:user)
+ target = attrs[:target] || insert(:user)
+ relationship_type = attrs[:relationship_type] || :block
+
+ %Pleroma.UserRelationship{
+ source_id: source.id,
+ target_id: target.id,
+ relationship_type: relationship_type
+ }
+ end
+
def note_factory(attrs \\ %{}) do
text = sequence(:text, &"This is :moominmamma: note #{&1}")