summaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/controllers/notification_controller_test.exs
diff options
context:
space:
mode:
authorEgor Kislitsyn <egor@kislitsyn.com>2019-12-03 22:13:38 +0700
committerEgor Kislitsyn <egor@kislitsyn.com>2019-12-03 22:13:38 +0700
commit624e720aa45fd54575d17a2b5e77c67deef6eb86 (patch)
tree68783e20f8bc9cc16837a194de4f15d526a60d61 /test/web/mastodon_api/controllers/notification_controller_test.exs
parent7722e5a67a46304f3ae0e37f674a44ca9268be5e (diff)
downloadpleroma-624e720aa45fd54575d17a2b5e77c67deef6eb86.tar.gz
pleroma-624e720aa45fd54575d17a2b5e77c67deef6eb86.zip
Add `with_move` query param to the notifications API
Diffstat (limited to 'test/web/mastodon_api/controllers/notification_controller_test.exs')
-rw-r--r--test/web/mastodon_api/controllers/notification_controller_test.exs26
1 files changed, 26 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 fa55a7cf9..349cca682 100644
--- a/test/web/mastodon_api/controllers/notification_controller_test.exs
+++ b/test/web/mastodon_api/controllers/notification_controller_test.exs
@@ -341,6 +341,32 @@ defmodule Pleroma.Web.MastodonAPI.NotificationControllerTest do
assert length(json_response(conn, 200)) == 1
end
+ test "see move notifications with `with_move` parameter", %{
+ conn: conn
+ } do
+ old_user = insert(:user)
+ new_user = insert(:user, also_known_as: [old_user.ap_id])
+ follower = insert(:user)
+
+ User.follow(follower, old_user)
+ Pleroma.Web.ActivityPub.ActivityPub.move(old_user, new_user)
+ Pleroma.Tests.ObanHelpers.perform_all()
+
+ conn =
+ conn
+ |> assign(:user, follower)
+ |> get("/api/v1/notifications")
+
+ assert json_response(conn, 200) == []
+
+ conn =
+ build_conn()
+ |> assign(:user, follower)
+ |> get("/api/v1/notifications", %{"with_move" => "true"})
+
+ assert length(json_response(conn, 200)) == 1
+ end
+
defp get_notification_id_by_activity(%{id: id}) do
Notification
|> Repo.get_by(activity_id: id)