aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2018-12-18 22:10:56 +0300
committerrinpatch <rinpatch@sdf.org>2018-12-18 22:10:56 +0300
commit8a67677d7791287905898bc388fbd8d9c81ec2b1 (patch)
treecacf089e3bcc2e087c7d3189a8068db58b13c8eb /test
parentef318fb8a96ddf276393f4ec81d3242dd7c6a4d4 (diff)
downloadpleroma-8a67677d7791287905898bc388fbd8d9c81ec2b1.tar.gz
Add test
Diffstat (limited to 'test')
-rw-r--r--test/formatter_test.exs12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/formatter_test.exs b/test/formatter_test.exs
index bb318b7d5..cfa735795 100644
--- a/test/formatter_test.exs
+++ b/test/formatter_test.exs
@@ -22,6 +22,18 @@ defmodule Pleroma.FormatterTest do
assert expected_text ==
Formatter.add_hashtag_links({[], text}, tags) |> Formatter.finalize()
end
+
+ test "does not turn html characters to tags" do
+ text = "Fact #3: pleroma does what mastodon't"
+
+ expected_text =
+ "Fact <a data-tag=\"3\" href=\"http://localhost:4001/tag/3\">#3</a>: pleroma does what mastodon't"
+
+ tags = Formatter.parse_tags(text)
+
+ assert expected_text ==
+ Formatter.add_hashtag_links({[], text}, tags) |> Formatter.finalize()
+ end
end
describe ".add_links" do