- test "it adds user links to an existing text" do
- text = "@gsimg According to @archaeme, that is @daggsy. Also hello @archaeme@archae.me"
-
- gsimg = insert(:user, %{nickname: "gsimg"})
- archaeme = insert(:user, %{nickname: "archaeme"})
- archaeme_remote = insert(:user, %{nickname: "archaeme@archae.me"})
-
- mentions = Pleroma.Formatter.parse_mentions(text)
- expected_text = "<a href='#{gsimg.ap_id}'>@gsimg</a> According to <a href='#{archaeme.ap_id}'>@archaeme</a>, that is @daggsy. Also hello <a href='#{archaeme_remote.ap_id}'>@archaeme</a>"
-
- assert Utils.add_user_links(text, mentions) == expected_text
- end
-