summaryrefslogtreecommitdiff
path: root/test/formatter_test.exs
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2019-01-13 13:38:28 +0300
committerrinpatch <rinpatch@sdf.org>2019-01-13 13:38:28 +0300
commite4dc3f71aea900e566c0d66ddffc5cd57e3920dd (patch)
treed0b0edfd3c7aa4c2015b0b461a4c40895e16eba9 /test/formatter_test.exs
parent9a6236e69d2709c0df374574fd77c4b2bc3d68fb (diff)
parent19b6a8239387869c69c6885044ee488d097b723f (diff)
downloadpleroma-e4dc3f71aea900e566c0d66ddffc5cd57e3920dd.tar.gz
pleroma-e4dc3f71aea900e566c0d66ddffc5cd57e3920dd.zip
Resolve merge conflict
Diffstat (limited to 'test/formatter_test.exs')
-rw-r--r--test/formatter_test.exs13
1 files changed, 11 insertions, 2 deletions
diff --git a/test/formatter_test.exs b/test/formatter_test.exs
index 6cdfa4167..c76149e38 100644
--- a/test/formatter_test.exs
+++ b/test/formatter_test.exs
@@ -1,3 +1,7 @@
+# Pleroma: A lightweight social networking server
+# Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
+# SPDX-License-Identifier: AGPL-3.0-only
+
defmodule Pleroma.FormatterTest do
alias Pleroma.Formatter
alias Pleroma.User
@@ -215,8 +219,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 +231,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