summaryrefslogtreecommitdiff
path: root/test/conversation_test.exs
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2019-05-03 13:39:14 +0200
committerlain <lain@soykaf.club>2019-05-03 13:39:14 +0200
commit81d1aa424d65b364ec8f2aee45247e7d95e3f255 (patch)
treef1851149c8eecf5871f4b72fb56ae89ae3b83243 /test/conversation_test.exs
parent8af55728e47f9f62d237704cd5a33fba5f946fa2 (diff)
downloadpleroma-81d1aa424d65b364ec8f2aee45247e7d95e3f255.tar.gz
pleroma-81d1aa424d65b364ec8f2aee45247e7d95e3f255.zip
Streamer: Stream out Conversations/Participations.
Diffstat (limited to 'test/conversation_test.exs')
-rw-r--r--test/conversation_test.exs17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/conversation_test.exs b/test/conversation_test.exs
index 763183d6b..f3300e7d1 100644
--- a/test/conversation_test.exs
+++ b/test/conversation_test.exs
@@ -117,4 +117,21 @@ defmodule Pleroma.ConversationTest do
tridi.id == user_id
end)
end
+
+ test "create_or_bump_for returns the conversation with participations" do
+ har = insert(:user)
+ jafnhar = insert(:user, local: false)
+
+ {:ok, activity} =
+ CommonAPI.post(har, %{"status" => "Hey @#{jafnhar.nickname}", "visibility" => "direct"})
+
+ {:ok, conversation} = Conversation.create_or_bump_for(activity)
+
+ assert length(conversation.participations) == 2
+
+ {:ok, activity} =
+ CommonAPI.post(har, %{"status" => "Hey @#{jafnhar.nickname}", "visibility" => "public"})
+
+ assert {:error, _} = Conversation.create_or_bump_for(activity)
+ end
end