diff options
author | kaniini <nenolod@gmail.com> | 2019-03-16 04:31:31 +0000 |
---|---|---|
committer | kaniini <nenolod@gmail.com> | 2019-03-16 04:31:31 +0000 |
commit | c69dc2acf1e4cb1afe61bda3566aec44d48a240f (patch) | |
tree | 919ef67a2b39f7c80c253fa8b940f1f37da17305 /test/web/common_api | |
parent | f58d47d6f752fa04bfd0a5d809b6d4e28248654d (diff) | |
parent | d8244c2a1bfc54b9dfa70be3ce49db961205f883 (diff) | |
download | pleroma-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')
-rw-r--r-- | test/web/common_api/common_api_test.exs | 23 |
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 |