diff options
author | rinpatch <rinpatch@sdf.org> | 2019-02-11 15:02:14 +0000 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2019-02-11 15:02:14 +0000 |
commit | 39383a6b79f5fe8e449d8e1acbc60f265065ad07 (patch) | |
tree | 0d8eeb5dc60d675dccbb9549c511d194ed31f761 /test/web/common_api/common_api_test.exs | |
parent | 044616292b6d441c2259d423d98b38f71019aae9 (diff) | |
parent | ac72b578da673282b927b945bfe03cd3012444b6 (diff) | |
download | pleroma-39383a6b79f5fe8e449d8e1acbc60f265065ad07.tar.gz |
Merge branch 'feature/thread-muting' into 'develop'
Feature/thread muting
See merge request pleroma/pleroma!796
Diffstat (limited to 'test/web/common_api/common_api_test.exs')
-rw-r--r-- | test/web/common_api/common_api_test.exs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs index a7d9e6161..d26b6e49c 100644 --- a/test/web/common_api/common_api_test.exs +++ b/test/web/common_api/common_api_test.exs @@ -164,4 +164,30 @@ defmodule Pleroma.Web.CommonAPI.Test do assert %User{info: %{pinned_activities: []}} = user end end + + describe "mute tests" do + setup do + user = insert(:user) + + activity = insert(:note_activity) + + [user: user, activity: activity] + end + + test "add mute", %{user: user, activity: activity} do + {:ok, _} = CommonAPI.add_mute(user, activity) + assert CommonAPI.thread_muted?(user, activity) + end + + test "remove mute", %{user: user, activity: activity} do + CommonAPI.add_mute(user, activity) + {:ok, _} = CommonAPI.remove_mute(user, activity) + refute CommonAPI.thread_muted?(user, activity) + end + + test "check that mutes can't be duplicate", %{user: user, activity: activity} do + CommonAPI.add_mute(user, activity) + {:error, _} = CommonAPI.add_mute(user, activity) + end + end end |