summaryrefslogtreecommitdiff
path: root/test/web/common_api
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-04-06 17:50:31 +0200
committerlain <lain@soykaf.club>2020-04-06 17:50:31 +0200
commit19335be24c25739e2334180af6c59dd8919d5fc8 (patch)
treedb34531b2dd5befb495d4379aa8aaad9284fa72c /test/web/common_api
parentfd97b0e634d30dec3217efcf3d67610d1b54bf8b (diff)
parent1d4ab06505ec5143dbb1d78d718fa9efd1497751 (diff)
downloadpleroma-19335be24c25739e2334180af6c59dd8919d5fc8.tar.gz
pleroma-19335be24c25739e2334180af6c59dd8919d5fc8.zip
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remake-remodel-dms
Diffstat (limited to 'test/web/common_api')
-rw-r--r--test/web/common_api/common_api_test.exs6
-rw-r--r--test/web/common_api/common_api_utils_test.exs7
2 files changed, 10 insertions, 3 deletions
diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs
index c2ed1c789..f46ad0272 100644
--- a/test/web/common_api/common_api_test.exs
+++ b/test/web/common_api/common_api_test.exs
@@ -17,9 +17,9 @@ defmodule Pleroma.Web.CommonAPITest do
require Pleroma.Constants
- clear_config([:instance, :safe_dm_mentions])
- clear_config([:instance, :limit])
- clear_config([:instance, :max_pinned_statuses])
+ setup do: clear_config([:instance, :safe_dm_mentions])
+ setup do: clear_config([:instance, :limit])
+ setup do: clear_config([:instance, :max_pinned_statuses])
test "when replying to a conversation / participation, it will set the correct context id even if no explicit reply_to is given" do
user = insert(:user)
diff --git a/test/web/common_api/common_api_utils_test.exs b/test/web/common_api/common_api_utils_test.exs
index 45fc94522..d383d1714 100644
--- a/test/web/common_api/common_api_utils_test.exs
+++ b/test/web/common_api/common_api_utils_test.exs
@@ -472,6 +472,13 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do
activity = insert(:note_activity, user: user, note: object)
Pleroma.Repo.delete(object)
+ obj_url = activity.data["object"]
+
+ Tesla.Mock.mock(fn
+ %{method: :get, url: ^obj_url} ->
+ %Tesla.Env{status: 404, body: ""}
+ end)
+
assert Utils.maybe_notify_mentioned_recipients(["test-test"], activity) == [
"test-test"
]