summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2018-04-03 18:32:46 +0200
committerlain <lain@soykaf.club>2018-04-03 18:32:46 +0200
commit806550c921d1137e47ec662ea83ee0a542fb55d5 (patch)
tree4a5d082effc5463f26c7ec6754cbca0437d84fd0 /test
parentb3b7ab5d9a0528bdfa385bd61d7f97ae4c7de374 (diff)
downloadpleroma-806550c921d1137e47ec662ea83ee0a542fb55d5.tar.gz
pleroma-806550c921d1137e47ec662ea83ee0a542fb55d5.zip
Use user url in mention if we have it.
Diffstat (limited to 'test')
-rw-r--r--test/formatter_test.exs10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/formatter_test.exs b/test/formatter_test.exs
index b7246252f..d9cef8abc 100644
--- a/test/formatter_test.exs
+++ b/test/formatter_test.exs
@@ -64,7 +64,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 +82,7 @@ defmodule Pleroma.FormatterTest do
expected_text =
"<span><a href='#{gsimg.ap_id}'>@<span>gsimg</span></a></span> According to <span><a href='#{
- archaeme.ap_id
+ "https://archeme/@archaeme"
}'>@<span>archaeme</span></a></span>, that is @daggsy. Also hello <span><a href='#{
archaeme_remote.ap_id
}'>@<span>archaeme</span></a></span>"