summaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/controllers/notification_controller_test.exs
diff options
context:
space:
mode:
authorMaksim Pechnikov <parallel588@gmail.com>2020-04-02 14:47:17 +0300
committerMaksim Pechnikov <parallel588@gmail.com>2020-04-02 14:47:17 +0300
commitdbcfac11b45b367185a3b18a2db3e3fb07e8f20d (patch)
tree039254a94616f04f4ea00e893bf0fb66dc06d9e8 /test/web/mastodon_api/controllers/notification_controller_test.exs
parentdfd2c741849e9afaf35e3ddbecbb50feb47f5d22 (diff)
parentfd932b14a7e7335a91a2acc2d6dd6fba7e2e90b3 (diff)
downloadpleroma-dbcfac11b45b367185a3b18a2db3e3fb07e8f20d.tar.gz
pleroma-dbcfac11b45b367185a3b18a2db3e3fb07e8f20d.zip
Merge branch 'develop' into issue/1276
Diffstat (limited to 'test/web/mastodon_api/controllers/notification_controller_test.exs')
-rw-r--r--test/web/mastodon_api/controllers/notification_controller_test.exs13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/web/mastodon_api/controllers/notification_controller_test.exs b/test/web/mastodon_api/controllers/notification_controller_test.exs
index 7a0011646..23f94e3a6 100644
--- a/test/web/mastodon_api/controllers/notification_controller_test.exs
+++ b/test/web/mastodon_api/controllers/notification_controller_test.exs
@@ -452,11 +452,24 @@ defmodule Pleroma.Web.MastodonAPI.NotificationControllerTest do
assert length(json_response(conn, 200)) == 1
end
+ @tag capture_log: true
test "see move notifications" do
old_user = insert(:user)
new_user = insert(:user, also_known_as: [old_user.ap_id])
%{user: follower, conn: conn} = oauth_access(["read:notifications"])
+ old_user_url = old_user.ap_id
+
+ body =
+ File.read!("test/fixtures/users_mock/localhost.json")
+ |> String.replace("{{nickname}}", old_user.nickname)
+ |> Jason.encode!()
+
+ Tesla.Mock.mock(fn
+ %{method: :get, url: ^old_user_url} ->
+ %Tesla.Env{status: 200, body: body}
+ end)
+
User.follow(follower, old_user)
Pleroma.Web.ActivityPub.ActivityPub.move(old_user, new_user)
Pleroma.Tests.ObanHelpers.perform_all()