Made a test!
[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 test "add a mute" do
12 user = insert(:user, %{id: "1"})
13
14 activity =
15 insert(:note_activity, %{
16 data: %{"context" => "http://localhost:4000/contexts/361ca23e-ffa7-4773-b981-a355a18dc592"}
17 })
18
19 id = activity.id
20 {:ok, mute} = add_mute(user, id)
21
22 assert mute.user_id == "1"
23 assert mute.context == "http://localhost:4000/contexts/361ca23e-ffa7-4773-b981-a355a18dc592"
24 end
25 end