diff options
author | lain <lain@soykaf.club> | 2019-05-03 13:39:14 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2019-05-03 13:39:14 +0200 |
commit | 81d1aa424d65b364ec8f2aee45247e7d95e3f255 (patch) | |
tree | f1851149c8eecf5871f4b72fb56ae89ae3b83243 /test/conversation_test.exs | |
parent | 8af55728e47f9f62d237704cd5a33fba5f946fa2 (diff) | |
download | pleroma-81d1aa424d65b364ec8f2aee45247e7d95e3f255.tar.gz pleroma-81d1aa424d65b364ec8f2aee45247e7d95e3f255.zip |
Streamer: Stream out Conversations/Participations.
Diffstat (limited to 'test/conversation_test.exs')
-rw-r--r-- | test/conversation_test.exs | 17 |
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 |