Merge remote-tracking branch 'pleroma/develop' into feature/disable-account
[akkoma] / test / support / factory.ex
index 608f8d46b0554ef7d461f8789026aa9825c6a363..2a2954ad615ea0993b1479f3f81b6c697bfdc267 100644 (file)
@@ -5,6 +5,23 @@
 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}")
+    }
+  end
+
   def user_factory do
     user = %Pleroma.User{
       name: sequence(:name, &"Test ใƒ†ใ‚นใƒˆ User #{&1}"),
@@ -275,4 +292,20 @@ defmodule Pleroma.Factory do
       params: build(:note) |> Map.from_struct() |> Map.get(:data)
     }
   end
+
+  def registration_factory do
+    user = insert(:user)
+
+    %Pleroma.Registration{
+      user: user,
+      provider: "twitter",
+      uid: "171799000",
+      info: %{
+        "name" => "John Doe",
+        "email" => "john@doe.com",
+        "nickname" => "johndoe",
+        "description" => "My bio"
+      }
+    }
+  end
 end