aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKaren Konou <konoukaren@gmail.com>2019-02-09 17:47:57 +0100
committerKaren Konou <konoukaren@gmail.com>2019-02-09 17:47:57 +0100
commita0d732ec55fcbce8cf345344d1456dc77bb0f3bf (patch)
tree050d0bbae605b270005d6e8aac9f8de28baa00d4 /test
parent4430a0ad127411b818d875dbbaf14369c109f331 (diff)
downloadpleroma-a0d732ec55fcbce8cf345344d1456dc77bb0f3bf.tar.gz
it works!!
Diffstat (limited to 'test')
-rw-r--r--test/web/thread_mute_test.exs25
1 files changed, 13 insertions, 12 deletions
diff --git a/test/web/thread_mute_test.exs b/test/web/thread_mute_test.exs
index 75277ef62..212cae860 100644
--- a/test/web/thread_mute_test.exs
+++ b/test/web/thread_mute_test.exs
@@ -10,31 +10,32 @@ defmodule Pleroma.Web.ThreadMuteTest do
describe "mute tests" do
setup do
- user = insert(:user, %{id: "1"})
+ user = insert(:user)
- activity =
- insert(:note_activity, %{
- data: %{
- "context" => "http://localhost:4000/contexts/361ca23e-ffa7-4773-b981-a355a18dc592"
- }
- })
+ activity = insert(:note_activity)
[user: user, activity: activity]
end
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"
+ {:ok, _activity} = add_mute(user, id)
end
test "remove mute", %{user: user, activity: activity} do
id = activity.id
add_mute(user, id)
- {1, nil} = remove_mute(user, id)
+ {:ok, _activity} = remove_mute(user, id)
+ end
+
+ test "check mute", %{user: user, activity: activity} do
+ id = activity.id
+
+ add_mute(user, id)
+ assert muted?(user, activity)
+ remove_mute(user, id)
+ refute muted?(user, activity)
end
end
end