X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fformatter_test.exs;h=f14077d25559d4f295e8a83bd1089479ea844679;hb=ea2698beb75074e6c94acf0c66bcdbdb47f59acd;hp=7040f1c276d312c29bcb5cd379537d2b5ee80b57;hpb=2bfae25a1ff735499e15cb431314503f34097a6b;p=akkoma diff --git a/test/formatter_test.exs b/test/formatter_test.exs index 7040f1c27..f14077d25 100644 --- a/test/formatter_test.exs +++ b/test/formatter_test.exs @@ -124,7 +124,7 @@ defmodule Pleroma.FormatterTest do end describe "add_user_links" do - test "gives a replacement for user links" do + test "gives a replacement for user links, using local nicknames in user links text" do text = "@gsimg According to @archa_eme_, that is @daggsy. Also hello @archaeme@archae.me" gsimg = insert(:user, %{nickname: "gsimg"}) @@ -150,7 +150,7 @@ defmodule Pleroma.FormatterTest do archaeme.id }' class='u-url mention' href='#{"https://archeme/@archa_eme_"}'>@archa_eme_, that is @daggsy. Also hello @archaeme@archae.me" + }' class='u-url mention' href='#{archaeme_remote.ap_id}'>@archaeme" assert expected_text == Formatter.finalize({subs, text}) end @@ -168,7 +168,7 @@ defmodule Pleroma.FormatterTest do Enum.each(subs, fn {uuid, _} -> assert String.contains?(text, uuid) end) expected_text = - "@mike@osada.macgirvin.com test" + "@mike test" assert expected_text == Formatter.finalize({subs, text}) end @@ -197,7 +197,7 @@ defmodule Pleroma.FormatterTest do {subs, text} = Formatter.add_user_links({[], text}, mentions) - assert length(subs) == 0 + assert Enum.empty?(subs) Enum.each(subs, fn {uuid, _} -> assert String.contains?(text, uuid) end) expected_text = "@a hi"