X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fconversation_test.exs;h=5903d10ff05b1ffd94b4d4594952a1b393283b6f;hb=ad5263c647aea65dbeb4c329825671895e0a8863;hp=864b2eb03066ec28f3244f6d6626f63fcd89a040;hpb=15cda998f3bdc03f58c30e34e35ebc026a90cf29;p=akkoma 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")