diff options
author | lain <lain@soykaf.club> | 2020-01-28 17:52:42 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-01-28 17:52:42 +0100 |
commit | cedee2793d96b0384a3041ea0a6cd1f2b1c3dd1e (patch) | |
tree | dfc1a2b2bb27d845bbde24b023287122f5d39ed7 /test/formatter_test.exs | |
parent | ae78059ff433739b83aaa3ccff9245ace153146d (diff) | |
parent | e8f22451da18aeba9bcf9f9f6acf93690ccb3cba (diff) | |
download | pleroma-cedee2793d96b0384a3041ea0a6cd1f2b1c3dd1e.tar.gz pleroma-cedee2793d96b0384a3041ea0a6cd1f2b1c3dd1e.zip |
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into features/remote-follow-userpage-redirect
Diffstat (limited to 'test/formatter_test.exs')
-rw-r--r-- | test/formatter_test.exs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/formatter_test.exs b/test/formatter_test.exs index 087bdbcc2..37f8bb800 100644 --- a/test/formatter_test.exs +++ b/test/formatter_test.exs @@ -119,7 +119,20 @@ defmodule Pleroma.FormatterTest do end end - describe "add_user_links" do + describe "Formatter.linkify" do + test "correctly finds mentions that contain the domain name" do + _user = insert(:user, %{nickname: "lain"}) + _remote_user = insert(:user, %{nickname: "lain@lain.com", local: false}) + + text = "hey @lain@lain.com what's up" + + {_text, mentions, []} = Formatter.linkify(text) + [{username, user}] = mentions + + assert username == "@lain@lain.com" + assert user.nickname == "lain@lain.com" + end + test "gives a replacement for user links, using local nicknames in user links text" do text = "@gsimg According to @archa_eme_, that is @daggsy. Also hello @archaeme@archae.me" gsimg = insert(:user, %{nickname: "gsimg"}) |