diff options
author | Sachin Joshi <satchin.joshi@gmail.com> | 2019-06-23 03:25:50 +0000 |
---|---|---|
committer | Sachin Joshi <satchin.joshi@gmail.com> | 2019-06-23 03:25:50 +0000 |
commit | a0c65bbd6c708b555f457bf24ec07d2d41c3fe4a (patch) | |
tree | deb176014e3c1dcb87fba2fe1108e276c2100148 /test/formatter_test.exs | |
parent | 1452a96ad6cfd7d250e3f7c10805994cc92016a7 (diff) | |
parent | 72f365df07e2eba75d3339629b01e5a8913513e6 (diff) | |
download | pleroma-a0c65bbd6c708b555f457bf24ec07d2d41c3fe4a.tar.gz pleroma-a0c65bbd6c708b555f457bf24ec07d2d41c3fe4a.zip |
Merge branch 'develop' into 'remove-avatar-header'
# Conflicts:
# CHANGELOG.md
Diffstat (limited to 'test/formatter_test.exs')
-rw-r--r-- | test/formatter_test.exs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/formatter_test.exs b/test/formatter_test.exs index 47b91b121..bfa673049 100644 --- a/test/formatter_test.exs +++ b/test/formatter_test.exs @@ -184,17 +184,19 @@ defmodule Pleroma.FormatterTest do test "given the 'safe_mention' option, it will only mention people in the beginning" do user = insert(:user) - _other_user = insert(:user) + other_user = insert(:user) third_user = insert(:user) - text = " @#{user.nickname} hey dude i hate @#{third_user.nickname}" + text = " @#{user.nickname} @#{other_user.nickname} hey dudes i hate @#{third_user.nickname}" {expected_text, mentions, [] = _tags} = Formatter.linkify(text, safe_mention: true) - assert mentions == [{"@#{user.nickname}", user}] + assert mentions == [{"@#{user.nickname}", user}, {"@#{other_user.nickname}", other_user}] assert expected_text == "<span class='h-card'><a data-user='#{user.id}' class='u-url mention' href='#{ user.ap_id - }'>@<span>#{user.nickname}</span></a></span> hey dude i hate <span class='h-card'><a data-user='#{ + }'>@<span>#{user.nickname}</span></a></span> <span class='h-card'><a data-user='#{ + other_user.id + }' class='u-url mention' href='#{other_user.ap_id}'>@<span>#{other_user.nickname}</span></a></span> hey dudes i hate <span class='h-card'><a data-user='#{ third_user.id }' class='u-url mention' href='#{third_user.ap_id}'>@<span>#{third_user.nickname}</span></a></span>" end |