Merged "check mute" test into the other two
[akkoma] / test / web / thread_mute_test.exs
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Web.ThreadMuteTest do
6 use Pleroma.DataCase
7 import Pleroma.Web.ThreadMute
8
9 import Pleroma.Factory
10
11 describe "mute tests" do
12 setup do
13 user = insert(:user)
14
15 activity = insert(:note_activity)
16
17 [user: user, activity: activity]
18 end
19
20 test "add mute", %{user: user, activity: activity} do
21 id = activity.id
22 {:ok, _activity} = add_mute(user, id)
23 assert muted?(user, activity)
24 end
25
26 test "remove mute", %{user: user, activity: activity} do
27 id = activity.id
28
29 add_mute(user, id)
30 {:ok, _activity} = remove_mute(user, id)
31 refute muted?(user, activity)
32 end
33 end
34 end