Merge branch 'improve-move-notificaions-api' into 'develop'

Add `with_move` query param to the notifications API

See merge request pleroma/pleroma!2032
This commit is contained in:
rinpatch 2019-12-08 13:07:05 +00:00
commit 8404f8c8fb
7 changed files with 60 additions and 16 deletions

View file

@ -643,13 +643,7 @@ defmodule Pleroma.NotificationTest do
Pleroma.Web.ActivityPub.ActivityPub.move(old_user, new_user)
ObanHelpers.perform_all()
assert [
%{
activity: %{
data: %{"type" => "Move", "actor" => ^old_ap_id, "target" => ^new_ap_id}
}
}
] = Notification.for_user(follower)
assert [] = Notification.for_user(follower)
assert [
%{
@ -657,7 +651,17 @@ defmodule Pleroma.NotificationTest do
data: %{"type" => "Move", "actor" => ^old_ap_id, "target" => ^new_ap_id}
}
}
] = Notification.for_user(other_follower)
] = Notification.for_user(follower, %{with_move: true})
assert [] = Notification.for_user(other_follower)
assert [
%{
activity: %{
data: %{"type" => "Move", "actor" => ^old_ap_id, "target" => ^new_ap_id}
}
}
] = Notification.for_user(other_follower, %{with_move: true})
end
end