diff options
author | Karen Konou <konoukaren@gmail.com> | 2019-03-15 14:06:58 +0100 |
---|---|---|
committer | Karen Konou <konoukaren@gmail.com> | 2019-03-15 14:20:08 +0100 |
commit | da53c079db91ce5d7ba14809f5e99b10d3ae307a (patch) | |
tree | ea630d9626675911e63f2f8a0f0834bb685505c3 /test/web/common_api | |
parent | be465c762be19eda6725d4f323798caa23241715 (diff) | |
download | pleroma-da53c079db91ce5d7ba14809f5e99b10d3ae307a.tar.gz |
Refactor to store user ap_id, add tests
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 |