Fix format.
authorlain <lain@soykaf.club>
Sun, 29 Apr 2018 09:28:26 +0000 (11:28 +0200)
committerlain <lain@soykaf.club>
Sun, 29 Apr 2018 09:28:26 +0000 (11:28 +0200)
lib/pleroma/web/twitter_api/twitter_api_controller.ex
test/web/twitter_api/twitter_api_controller_test.exs

index e8fc9c29148527dcb36bfcd73e5f86326bfe30e6..960925f4266c28a0e525c2fadf8b2d4a7856678a 100644 (file)
@@ -347,7 +347,7 @@ defmodule Pleroma.Web.TwitterAPI.Controller do
   def update_profile(%{assigns: %{user: user}} = conn, params) do
     params =
       if bio = params["description"] do
-        bio_brs = Regex.replace(~r/\r?\n/,bio,"<br>")
+        bio_brs = Regex.replace(~r/\r?\n/, bio, "<br>")
         Map.put(params, "bio", bio_brs)
       else
         params
index c239239d35c520fff822b6ec1d6cf8a4bc9d4be6..d7113979ac0262af26bbcd1b92ef1b45cadbf0e0 100644 (file)
@@ -786,18 +786,16 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do
   end
 
   test "Convert newlines to <br> in bio", %{conn: conn} do
-      user = insert(:user)
+    user = insert(:user)
 
-      conn =
-            conn
-        |> assign(:user, user)
-        |> post("/api/account/update_profile.json", %{
-                "description" => "Hello,\r\nWorld! I\n am a test."
-              })
+    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."
+    user = Repo.get!(User, user.id)
+    assert user.bio == "Hello,<br>World! I<br> am a test."
   end
-
-  
 end