summaryrefslogtreecommitdiff
path: root/test/web/common_api
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2019-02-17 14:07:04 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2019-02-17 14:07:04 +0300
commitbc4f77b10bb4360ac00d1999b1d08fa55e1fa547 (patch)
tree8c87c2cefd1e325a64a19c04d7d7d70ffd8cc485 /test/web/common_api
parentdcf24a3233bb50689d26f9d7833f98158730ce35 (diff)
parent3b141194715e362d65482672d00b10991d102fa2 (diff)
downloadpleroma-bc4f77b10bb4360ac00d1999b1d08fa55e1fa547.tar.gz
pleroma-bc4f77b10bb4360ac00d1999b1d08fa55e1fa547.zip
[#468] Merged `upstream/develop`, resolved conflicts.
Diffstat (limited to 'test/web/common_api')
-rw-r--r--test/web/common_api/common_api_test.exs26
-rw-r--r--test/web/common_api/common_api_utils_test.exs2
2 files changed, 27 insertions, 1 deletions
diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs
index a7d9e6161..d26b6e49c 100644
--- a/test/web/common_api/common_api_test.exs
+++ b/test/web/common_api/common_api_test.exs
@@ -164,4 +164,30 @@ defmodule Pleroma.Web.CommonAPI.Test do
assert %User{info: %{pinned_activities: []}} = user
end
end
+
+ describe "mute tests" do
+ setup do
+ user = insert(:user)
+
+ activity = insert(:note_activity)
+
+ [user: user, activity: activity]
+ end
+
+ test "add mute", %{user: user, activity: activity} do
+ {:ok, _} = CommonAPI.add_mute(user, activity)
+ assert CommonAPI.thread_muted?(user, activity)
+ end
+
+ test "remove mute", %{user: user, activity: activity} do
+ CommonAPI.add_mute(user, activity)
+ {:ok, _} = CommonAPI.remove_mute(user, activity)
+ refute CommonAPI.thread_muted?(user, activity)
+ end
+
+ test "check that mutes can't be duplicate", %{user: user, activity: activity} do
+ CommonAPI.add_mute(user, activity)
+ {:error, _} = CommonAPI.add_mute(user, activity)
+ end
+ end
end
diff --git a/test/web/common_api/common_api_utils_test.exs b/test/web/common_api/common_api_utils_test.exs
index 754bc7255..faed6b685 100644
--- a/test/web/common_api/common_api_utils_test.exs
+++ b/test/web/common_api/common_api_utils_test.exs
@@ -5,7 +5,7 @@
defmodule Pleroma.Web.CommonAPI.UtilsTest do
alias Pleroma.Web.CommonAPI.Utils
alias Pleroma.Web.Endpoint
- alias Pleroma.Builders.{UserBuilder}
+ alias Pleroma.Builders.UserBuilder
use Pleroma.DataCase
test "it adds attachment links to a given text and attachment set" do