summaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/controllers/notification_controller_test.exs
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/mastodon_api/controllers/notification_controller_test.exs
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/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 adbb78da6..344eabb4a 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()