diff options
| author | lain <lain@soykaf.club> | 2020-06-01 15:14:22 +0200 | 
|---|---|---|
| committer | lain <lain@soykaf.club> | 2020-06-01 15:14:22 +0200 | 
| commit | af9090238e1f71e6b081fbd09c09a5975d2ed99e (patch) | |
| tree | 8930568a6cea53e180e2e8d9a79808d1815a22a6 /test/web/common_api | |
| parent | 8ff342582839259f3b8e039c6b3da3c0cf798a1f (diff) | |
| download | pleroma-af9090238e1f71e6b081fbd09c09a5975d2ed99e.tar.gz pleroma-af9090238e1f71e6b081fbd09c09a5975d2ed99e.zip | |
CommonAPI: Newlines -> br for chat messages.
Diffstat (limited to 'test/web/common_api')
| -rw-r--r-- | test/web/common_api/common_api_test.exs | 20 | 
1 files changed, 20 insertions, 0 deletions
| diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs index 41c6909de..611a9ae66 100644 --- a/test/web/common_api/common_api_test.exs +++ b/test/web/common_api/common_api_test.exs @@ -50,6 +50,26 @@ defmodule Pleroma.Web.CommonAPITest do        assert activity      end +    test "it adds html newlines" do +      author = insert(:user) +      recipient = insert(:user) + +      other_user = insert(:user) + +      {:ok, activity} = +        CommonAPI.post_chat_message( +          author, +          recipient, +          "uguu\nuguuu" +        ) + +      assert other_user.ap_id not in activity.recipients + +      object = Object.normalize(activity, false) + +      assert object.data["content"] == "uguu<br/>uguuu" +    end +      test "it linkifies" do        author = insert(:user)        recipient = insert(:user) | 
