diff options
Diffstat (limited to 'test/web/common_api')
| -rw-r--r-- | test/web/common_api/common_api_test.exs | 6 | ||||
| -rw-r--r-- | test/web/common_api/common_api_utils_test.exs | 7 | 
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"               ] | 
