aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Konou <konoukaren@gmail.com>2019-02-09 14:23:51 +0100
committerKaren Konou <konoukaren@gmail.com>2019-02-09 14:23:51 +0100
commit09189c3a7c61d15dc8c73c2474df19320f5032d0 (patch)
treefca23efc843d769917c02cd488a4f1609bd44cfb
parent7e47a810a27f8e4f67d3e821d2a51e14c444e9db (diff)
downloadpleroma-09189c3a7c61d15dc8c73c2474df19320f5032d0.tar.gz
Made a test!
-rw-r--r--test/web/thread_mute_test.exs25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/web/thread_mute_test.exs b/test/web/thread_mute_test.exs
new file mode 100644
index 000000000..4dea44d2f
--- /dev/null
+++ b/test/web/thread_mute_test.exs
@@ -0,0 +1,25 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
+defmodule Pleroma.Web.ThreadMuteTest do
+ use Pleroma.DataCase
+ import Pleroma.Web.ThreadMute
+
+ import Pleroma.Factory
+
+ test "add a mute" do
+ user = insert(:user, %{id: "1"})
+
+ activity =
+ insert(:note_activity, %{
+ data: %{"context" => "http://localhost:4000/contexts/361ca23e-ffa7-4773-b981-a355a18dc592"}
+ })
+
+ id = activity.id
+ {:ok, mute} = add_mute(user, id)
+
+ assert mute.user_id == "1"
+ assert mute.context == "http://localhost:4000/contexts/361ca23e-ffa7-4773-b981-a355a18dc592"
+ end
+end