aboutsummaryrefslogtreecommitdiff
path: root/test/web/common_api/common_api_test.exs
diff options
context:
space:
mode:
authorkaniini <nenolod@gmail.com>2019-03-16 04:31:31 +0000
committerkaniini <nenolod@gmail.com>2019-03-16 04:31:31 +0000
commitc69dc2acf1e4cb1afe61bda3566aec44d48a240f (patch)
tree919ef67a2b39f7c80c253fa8b940f1f37da17305 /test/web/common_api/common_api_test.exs
parentf58d47d6f752fa04bfd0a5d809b6d4e28248654d (diff)
parentd8244c2a1bfc54b9dfa70be3ce49db961205f883 (diff)
downloadpleroma-c69dc2acf1e4cb1afe61bda3566aec44d48a240f.tar.gz
Merge branch 'feature/reblog-muting' into 'develop'
Implement mastodon's reblog hiding feature See merge request pleroma/pleroma!916
Diffstat (limited to 'test/web/common_api/common_api_test.exs')
-rw-r--r--test/web/common_api/common_api_test.exs23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs
index 181813c76..f83f80b40 100644
--- a/test/web/common_api/common_api_test.exs
+++ b/test/web/common_api/common_api_test.exs
@@ -221,4 +221,27 @@ defmodule Pleroma.Web.CommonAPITest do
} = flag_activity
end
end
+
+ describe "reblog muting" do
+ setup do
+ muter = insert(:user)
+
+ muted = insert(:user)
+
+ [muter: muter, muted: muted]
+ end
+
+ test "add a reblog mute", %{muter: muter, muted: muted} do
+ {:ok, muter} = CommonAPI.hide_reblogs(muter, muted)
+
+ assert Pleroma.User.showing_reblogs?(muter, muted) == false
+ end
+
+ test "remove a reblog mute", %{muter: muter, muted: muted} do
+ {:ok, muter} = CommonAPI.hide_reblogs(muter, muted)
+ {:ok, muter} = CommonAPI.show_reblogs(muter, muted)
+
+ assert Pleroma.User.showing_reblogs?(muter, muted) == true
+ end
+ end
end