Made a test!
authorKaren Konou <konoukaren@gmail.com>
Sat, 9 Feb 2019 13:23:51 +0000 (14:23 +0100)
committerKaren Konou <konoukaren@gmail.com>
Sat, 9 Feb 2019 13:23:51 +0000 (14:23 +0100)
test/web/thread_mute_test.exs [new file with mode: 0644]

diff --git a/test/web/thread_mute_test.exs b/test/web/thread_mute_test.exs
new file mode 100644 (file)
index 0000000..4dea44d
--- /dev/null
@@ -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