diff options
author | rinpatch <rinpatch@sdf.org> | 2018-12-18 22:10:56 +0300 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2018-12-18 22:10:56 +0300 |
commit | 8a67677d7791287905898bc388fbd8d9c81ec2b1 (patch) | |
tree | cacf089e3bcc2e087c7d3189a8068db58b13c8eb /test | |
parent | ef318fb8a96ddf276393f4ec81d3242dd7c6a4d4 (diff) | |
download | pleroma-8a67677d7791287905898bc388fbd8d9c81ec2b1.tar.gz |
Add test
Diffstat (limited to 'test')
-rw-r--r-- | test/formatter_test.exs | 12 |
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 |