Added a test (written by @andrewzah) for the MR
authorWim Vanderbauwhede <Wim.Vanderbauwhede@mail.be>
Sat, 28 Apr 2018 11:01:43 +0000 (12:01 +0100)
committerWim Vanderbauwhede <Wim.Vanderbauwhede@mail.be>
Sat, 28 Apr 2018 11:01:43 +0000 (12:01 +0100)
test/web/twitter_api/twitter_api_controller_test.exs

index 406dace1cdb74832ed70cf0834618fe9a63ca5e6..c239239d35c520fff822b6ec1d6cf8a4bc9d4be6 100644 (file)
@@ -784,4 +784,20 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do
       assert status["id"] == activity.id
     end
   end
+
+  test "Convert newlines to <br> in bio", %{conn: conn} do
+      user = insert(:user)
+
+      conn =
+            conn
+        |> assign(:user, user)
+        |> post("/api/account/update_profile.json", %{
+                "description" => "Hello,\r\nWorld! I\n am a test."
+              })
+
+      user = Repo.get!(User, user.id)
+      assert user.bio == "Hello,<br>World! I<br> am a test."
+  end
+
+  
 end