diff options
author | Mark Felder <feld@feld.me> | 2021-06-12 12:41:12 -0500 |
---|---|---|
committer | Mark Felder <feld@feld.me> | 2021-06-12 12:41:12 -0500 |
commit | e0a521bbfb3df5792d0c6879df71338a4c9e3f26 (patch) | |
tree | 1097f290bb15931ccdd3c56682e49a293ad7beeb /test | |
parent | bb4130d48c4831e704155b45fed889dc71efd254 (diff) | |
download | pleroma-e0a521bbfb3df5792d0c6879df71338a4c9e3f26.tar.gz |
Web Push notifications should not embed HTML for preserving newlines, so give it its own filtering
Diffstat (limited to 'test')
-rw-r--r-- | test/pleroma/web/push/impl_test.exs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/pleroma/web/push/impl_test.exs b/test/pleroma/web/push/impl_test.exs index b3ca1a337..24304a317 100644 --- a/test/pleroma/web/push/impl_test.exs +++ b/test/pleroma/web/push/impl_test.exs @@ -359,4 +359,29 @@ defmodule Pleroma.Web.Push.ImplTest do } end end + + test "body for create activity handles newlines" do + user = insert(:user, nickname: "bob") + _user2 = insert(:user, nickname: "alice") + + {:ok, activity} = + CommonAPI.post(user, %{ + status: """ + @alice Line one + Line two + Line three + """ + }) + + object = Object.normalize(activity, fetch: false) + + assert Impl.format_body( + %{ + activity: activity + }, + user, + object + ) == + "@bob: @alice Line one\r\nLine two\r\nLine three" + end end |