diff options
author | rinpatch <rinpatch@sdf.org> | 2019-05-16 18:32:42 +0000 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2019-05-16 18:32:42 +0000 |
commit | ad76307a825689017f42a11849ad235d3c3b7cc8 (patch) | |
tree | cf1a0f21f7370e0f833bde853367c7d7a7f9906b /test | |
parent | fde30aee43edd50a40dd4bfdc0008f5395dfc751 (diff) | |
parent | cd127d2fa43e6b1ecd7fadfc1d6293b2a432be18 (diff) | |
download | pleroma-ad76307a825689017f42a11849ad235d3c3b7cc8.tar.gz pleroma-ad76307a825689017f42a11849ad235d3c3b7cc8.zip |
Merge branch 'conversations-import' into 'develop'
Conversations import
Closes #871
See merge request pleroma/pleroma!1127
Diffstat (limited to 'test')
-rw-r--r-- | test/conversation_test.exs | 20 | ||||
-rw-r--r-- | test/web/activity_pub/visibilty_test.exs | 10 |
2 files changed, 30 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") diff --git a/test/web/activity_pub/visibilty_test.exs b/test/web/activity_pub/visibilty_test.exs index 9c03c8be2..e2584f635 100644 --- a/test/web/activity_pub/visibilty_test.exs +++ b/test/web/activity_pub/visibilty_test.exs @@ -96,6 +96,16 @@ defmodule Pleroma.Web.ActivityPub.VisibilityTest do refute Visibility.visible_for_user?(direct, unrelated) end + test "doesn't die when the user doesn't exist", + %{ + direct: direct, + user: user + } do + Repo.delete(user) + Cachex.clear(:user_cache) + refute Visibility.is_private?(direct) + end + test "get_visibility", %{ public: public, private: private, |