fix all tests
[akkoma] / test / pleroma / web / common_api / utils_test.exs
index d8fec35208bd47d41703a66a3e39f35936ccc0ff..c4f506fe35ea9f176321579464b239820f9a796e 100644 (file)
@@ -160,11 +160,7 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do
       {output, _, _} = Utils.format_input(text, "text/markdown")
 
       assert output ==
-               ~s(<p><strong>hello world</strong></p><p><em>another <span class="h-card"><a class="u-url mention" data-user="#{
-                 user.id
-               }" href="http://foo.com/user__test" rel="ugc">@<span>user__test</span></a></span> and <span class="h-card"><a class="u-url mention" data-user="#{
-                 user.id
-               }" href="http://foo.com/user__test" rel="ugc">@<span>user__test</span></a></span> <a href="http://google.com" rel="ugc">google.com</a> paragraph</em></p>)
+               ~s(<p><strong>hello world</strong></p><p><em>another <span class="h-card"><a class="u-url mention" data-user="#{user.id}" href="http://foo.com/user__test" rel="ugc">@<span>user__test</span></a></span> and <span class="h-card"><a class="u-url mention" data-user="#{user.id}" href="http://foo.com/user__test" rel="ugc">@<span>user__test</span></a></span> <a href="http://google.com" rel="ugc">google.com</a> paragraph</em></p>)
     end
   end
 
@@ -201,11 +197,7 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do
       {result, _, []} = Utils.format_input(code, "text/markdown")
 
       assert result ==
-               ~s[<p><span class="h-card"><a class="u-url mention" data-user="#{mario.id}" href="#{
-                 mario.ap_id
-               }" rel="ugc">@<span>mario</span></a></span> <span class="h-card"><a class="u-url mention" data-user="#{
-                 luigi.id
-               }" href="#{luigi.ap_id}" rel="ugc">@<span>luigi</span></a></span> yo what’s up?</p>]
+               ~s[<p><span class="h-card"><a class="u-url mention" data-user="#{mario.id}" href="#{mario.ap_id}" rel="ugc">@<span>mario</span></a></span> <span class="h-card"><a class="u-url mention" data-user="#{luigi.id}" href="#{luigi.ap_id}" rel="ugc">@<span>luigi</span></a></span> yo what’s up?</p>]
     end
 
     test "remote mentions" do
@@ -216,11 +208,7 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do
       {result, _, []} = Utils.format_input(code, "text/markdown")
 
       assert result ==
-               ~s[<p><span class="h-card"><a class="u-url mention" data-user="#{mario.id}" href="#{
-                 mario.ap_id
-               }" rel="ugc">@<span>mario</span></a></span> <span class="h-card"><a class="u-url mention" data-user="#{
-                 luigi.id
-               }" href="#{luigi.ap_id}" rel="ugc">@<span>luigi</span></a></span> yo what’s up?</p>]
+               ~s[<p><span class="h-card"><a class="u-url mention" data-user="#{mario.id}" href="#{mario.ap_id}" rel="ugc">@<span>mario</span></a></span> <span class="h-card"><a class="u-url mention" data-user="#{luigi.id}" href="#{luigi.ap_id}" rel="ugc">@<span>luigi</span></a></span> yo what’s up?</p>]
     end
 
     test "raw HTML" do
@@ -321,7 +309,7 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do
 
       assert capture_log(fn ->
                assert Utils.date_to_asctime(date) == expected
-             end) =~ "[warn] Date #{date} in wrong format, must be ISO 8601"
+             end) =~ "[warning] Date #{date} in wrong format, must be ISO 8601"
     end
 
     test "when date is a Unix timestamp" do
@@ -331,7 +319,7 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do
 
       assert capture_log(fn ->
                assert Utils.date_to_asctime(date) == expected
-             end) =~ "[warn] Date #{date} in wrong format, must be ISO 8601"
+             end) =~ "[warning] Date #{date} in wrong format, must be ISO 8601"
     end
 
     test "when date is nil" do
@@ -339,13 +327,13 @@ defmodule Pleroma.Web.CommonAPI.UtilsTest do
 
       assert capture_log(fn ->
                assert Utils.date_to_asctime(nil) == expected
-             end) =~ "[warn] Date  in wrong format, must be ISO 8601"
+             end) =~ "[warning] Date  in wrong format, must be ISO 8601"
     end
 
     test "when date is a random string" do
       assert capture_log(fn ->
                assert Utils.date_to_asctime("foo") == ""
-             end) =~ "[warn] Date foo in wrong format, must be ISO 8601"
+             end) =~ "[warning] Date foo in wrong format, must be ISO 8601"
     end
   end