diff options
author | marcin mikołajczak <git@mkljczk.pl> | 2022-10-01 23:28:02 +0200 |
---|---|---|
committer | marcin mikołajczak <git@mkljczk.pl> | 2022-10-01 23:28:02 +0200 |
commit | 1b238a4fadd50811b1cce64812858c101e790c60 (patch) | |
tree | c266ef7b2edbf7fc2d5c1b94a11d263826404213 /test | |
parent | 3f1c31b7cd07a4d07e3ec407534c80a14f02294a (diff) | |
download | pleroma-1b238a4fadd50811b1cce64812858c101e790c60.tar.gz pleroma-1b238a4fadd50811b1cce64812858c101e790c60.zip |
Push.Impl: support edits
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
Diffstat (limited to 'test')
-rw-r--r-- | test/pleroma/web/push/impl_test.exs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/pleroma/web/push/impl_test.exs b/test/pleroma/web/push/impl_test.exs index b8112cce5..2eee0acd9 100644 --- a/test/pleroma/web/push/impl_test.exs +++ b/test/pleroma/web/push/impl_test.exs @@ -202,6 +202,21 @@ defmodule Pleroma.Web.Push.ImplTest do "New Reaction" end + test "renders title and body for update activity" do + user = insert(:user) + + {:ok, activity} = CommonAPI.post(user, %{status: "lorem ipsum"}) + + {:ok, activity} = CommonAPI.update(user, activity, %{status: "edited status"}) + object = Object.normalize(activity, fetch: false) + + assert Impl.format_body(%{activity: activity, type: "update"}, user, object) == + "@#{user.nickname} edited a status" + + assert Impl.format_title(%{activity: activity, type: "update"}) == + "New Update" + end + test "renders title for create activity with direct visibility" do user = insert(:user, nickname: "Bob") |