aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorkaniini <nenolod@gmail.com>2018-12-20 09:35:01 +0000
committerkaniini <nenolod@gmail.com>2018-12-20 09:35:01 +0000
commit8de3138de07c0447ea3bc015ff71db25f8f9c931 (patch)
tree3387fcd593ff03a25dd763c2ad40b0a5c0933e82 /test
parentc52453fbd66ac7667251942bbd4c74983d745df8 (diff)
parentf1b93b5be761826af9b833411689e9e0c086b815 (diff)
downloadpleroma-8de3138de07c0447ea3bc015ff71db25f8f9c931.tar.gz
Merge branch 'support/issue_413' into 'develop'
[#413] fix parse mentions See merge request pleroma/pleroma!577
Diffstat (limited to 'test')
-rw-r--r--test/formatter_test.exs9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/formatter_test.exs b/test/formatter_test.exs
index 6cdfa4167..584700b6a 100644
--- a/test/formatter_test.exs
+++ b/test/formatter_test.exs
@@ -215,8 +215,11 @@ defmodule Pleroma.FormatterTest do
end
test "it can parse mentions and return the relevant users" do
- text = "@gsimg According to @archaeme, that is @daggsy. Also hello @archaeme@archae.me"
+ text =
+ "@@gsimg According to @archaeme, that is @daggsy. Also hello @archaeme@archae.me and @o and @@@jimm"
+ o = insert(:user, %{nickname: "o"})
+ jimm = insert(:user, %{nickname: "jimm"})
gsimg = insert(:user, %{nickname: "gsimg"})
archaeme = insert(:user, %{nickname: "archaeme"})
archaeme_remote = insert(:user, %{nickname: "archaeme@archae.me"})
@@ -224,7 +227,9 @@ defmodule Pleroma.FormatterTest do
expected_result = [
{"@gsimg", gsimg},
{"@archaeme", archaeme},
- {"@archaeme@archae.me", archaeme_remote}
+ {"@archaeme@archae.me", archaeme_remote},
+ {"@o", o},
+ {"@jimm", jimm}
]
assert Formatter.parse_mentions(text) == expected_result