aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Konou <konoukaren@gmail.com>2019-02-09 14:34:42 +0100
committerKaren Konou <konoukaren@gmail.com>2019-02-09 14:34:42 +0100
commit4430a0ad127411b818d875dbbaf14369c109f331 (patch)
tree887b234fb9d2faad1dab11bf2c896c686f91b4e8
parent09189c3a7c61d15dc8c73c2474df19320f5032d0 (diff)
downloadpleroma-4430a0ad127411b818d875dbbaf14369c109f331.tar.gz
added another test
-rw-r--r--test/web/thread_mute_test.exs35
1 files changed, 25 insertions, 10 deletions
diff --git a/test/web/thread_mute_test.exs b/test/web/thread_mute_test.exs
index 4dea44d2f..75277ef62 100644
--- a/test/web/thread_mute_test.exs
+++ b/test/web/thread_mute_test.exs
@@ -8,18 +8,33 @@ defmodule Pleroma.Web.ThreadMuteTest do
import Pleroma.Factory
- test "add a mute" do
- user = insert(:user, %{id: "1"})
+ describe "mute tests" do
+ setup do
+ user = insert(:user, %{id: "1"})
- activity =
- insert(:note_activity, %{
- data: %{"context" => "http://localhost:4000/contexts/361ca23e-ffa7-4773-b981-a355a18dc592"}
- })
+ activity =
+ insert(:note_activity, %{
+ data: %{
+ "context" => "http://localhost:4000/contexts/361ca23e-ffa7-4773-b981-a355a18dc592"
+ }
+ })
- id = activity.id
- {:ok, mute} = add_mute(user, id)
+ [user: user, activity: activity]
+ end
- assert mute.user_id == "1"
- assert mute.context == "http://localhost:4000/contexts/361ca23e-ffa7-4773-b981-a355a18dc592"
+ test "add mute", %{user: user, activity: activity} do
+ 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
+
+ test "remove mute", %{user: user, activity: activity} do
+ id = activity.id
+
+ add_mute(user, id)
+ {1, nil} = remove_mute(user, id)
+ end
end
end