diff options
author | kaniini <nenolod@gmail.com> | 2019-01-19 07:36:58 +0000 |
---|---|---|
committer | kaniini <nenolod@gmail.com> | 2019-01-19 07:36:58 +0000 |
commit | 651ce1c97bf0754f170032b47abcb19ac0794e74 (patch) | |
tree | b62cb31ac6f8c42230c99e522c0f7d2f042f26d6 /test | |
parent | 98d9dcd509ab6823e38b3ddbce1f5fc4f3d5a82c (diff) | |
parent | 65bb9b2fba7560df7331645db9839305c47dad11 (diff) | |
download | pleroma-651ce1c97bf0754f170032b47abcb19ac0794e74.tar.gz pleroma-651ce1c97bf0754f170032b47abcb19ac0794e74.zip |
Merge branch '491_full_mentions_in_user_bio' into 'develop'
[#491] Made user bio preserve full nicknames (nick@host)
Closes #491
See merge request pleroma/pleroma!676
Diffstat (limited to 'test')
-rw-r--r-- | test/formatter_test.exs | 2 | ||||
-rw-r--r-- | test/user_test.exs | 15 |
2 files changed, 16 insertions, 1 deletions
diff --git a/test/formatter_test.exs b/test/formatter_test.exs index bd8844458..2e717194b 100644 --- a/test/formatter_test.exs +++ b/test/formatter_test.exs @@ -124,7 +124,7 @@ defmodule Pleroma.FormatterTest do end describe "add_user_links" do - test "gives a replacement for user links" do + 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"}) diff --git a/test/user_test.exs b/test/user_test.exs index cfccce8d1..21a62483f 100644 --- a/test/user_test.exs +++ b/test/user_test.exs @@ -874,4 +874,19 @@ defmodule Pleroma.UserTest do Pleroma.Config.put([:instance, :account_activation_required], false) end end + + describe "parse_bio/2" do + test "preserves hosts in user links text" do + remote_user = insert(:user, local: false, nickname: "nick@domain.com") + user = insert(:user) + bio = "A.k.a. @nick@domain.com" + + expected_text = + "A.k.a. <span class='h-card'><a data-user='#{remote_user.id}' class='u-url mention' href='#{ + remote_user.ap_id + }'>" <> "@<span>nick@domain.com</span></a></span>" + + assert expected_text == User.parse_bio(bio, user) + end + end end |