aboutsummaryrefslogtreecommitdiff
path: root/test/conversation_test.exs
diff options
context:
space:
mode:
Diffstat (limited to 'test/conversation_test.exs')
-rw-r--r--test/conversation_test.exs20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/conversation_test.exs b/test/conversation_test.exs
index 864b2eb03..5903d10ff 100644
--- a/test/conversation_test.exs
+++ b/test/conversation_test.exs
@@ -11,6 +11,26 @@ defmodule Pleroma.ConversationTest do
import Pleroma.Factory
+ test "it goes through old direct conversations" do
+ user = insert(:user)
+ other_user = insert(:user)
+
+ {:ok, _activity} =
+ CommonAPI.post(user, %{"visibility" => "direct", "status" => "hey @#{other_user.nickname}"})
+
+ Repo.delete_all(Conversation)
+ Repo.delete_all(Conversation.Participation)
+
+ refute Repo.one(Conversation)
+
+ Conversation.bump_for_all_activities()
+
+ assert Repo.one(Conversation)
+ [participation, _p2] = Repo.all(Conversation.Participation)
+
+ assert participation.read
+ end
+
test "it creates a conversation for given ap_id" do
assert {:ok, %Conversation{} = conversation} =
Conversation.create_for_ap_id("https://some_ap_id")