aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/web/push/impl_test.exs25
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