X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fformatter_test.exs;h=4c65b26f2817f91b399c221a52226fcaf90e7cbf;hb=60f92e406ce1b270f40e4de0a445536cd02e1973;hp=b7246252f732c1b7410339f45d5a016cc17a6c80;hpb=4afbef39f49948ddd3b1cd1bbda58ff7e3ac2785;p=akkoma
diff --git a/test/formatter_test.exs b/test/formatter_test.exs
index b7246252f..4c65b26f2 100644
--- a/test/formatter_test.exs
+++ b/test/formatter_test.exs
@@ -34,6 +34,13 @@ defmodule Pleroma.FormatterTest do
assert Formatter.add_links({[], text}) |> Formatter.finalize() == expected
+ text = "https://mastodon.social:4000/@lambadalambda"
+
+ expected =
+ "https://mastodon.social:4000/@lambadalambda"
+
+ assert Formatter.add_links({[], text}) |> Formatter.finalize() == expected
+
text = "@lambadalambda"
expected = "@lambadalambda"
@@ -57,6 +64,13 @@ defmodule Pleroma.FormatterTest do
"https://en.wikipedia.org/wiki/Sophia_(Gnosticism)#Mythos_of_the_soul"
assert Formatter.add_links({[], text}) |> Formatter.finalize() == expected
+
+ text = "https://www.google.co.jp/search?q=Nasim+Aghdam"
+
+ expected =
+ "https://www.google.co.jp/search?q=Nasim+Aghdam"
+
+ assert Formatter.add_links({[], text}) |> Formatter.finalize() == expected
end
end
@@ -64,7 +78,13 @@ defmodule Pleroma.FormatterTest do
test "gives a replacement for user links" do
text = "@gsimg According to @archaeme, that is @daggsy. Also hello @archaeme@archae.me"
gsimg = insert(:user, %{nickname: "gsimg"})
- archaeme = insert(:user, %{nickname: "archaeme"})
+
+ archaeme =
+ insert(:user, %{
+ nickname: "archaeme",
+ info: %{"source_data" => %{"url" => "https://archeme/@archaeme"}}
+ })
+
archaeme_remote = insert(:user, %{nickname: "archaeme@archae.me"})
mentions = Pleroma.Formatter.parse_mentions(text)
@@ -76,7 +96,7 @@ defmodule Pleroma.FormatterTest do
expected_text =
"@gsimg According to @archaeme, that is @daggsy. Also hello @archaeme"