[#413] fix parse mentions
This commit is contained in:
parent
c52453fbd6
commit
f1b93b5be7
2 changed files with 16 additions and 9 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue