Add test
This commit is contained in:
parent
ef318fb8a9
commit
8a67677d77
1 changed files with 12 additions and 0 deletions
|
@ -22,6 +22,18 @@ test "turns hashtags into links" do
|
||||||
assert expected_text ==
|
assert expected_text ==
|
||||||
Formatter.add_hashtag_links({[], text}, tags) |> Formatter.finalize()
|
Formatter.add_hashtag_links({[], text}, tags) |> Formatter.finalize()
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
describe ".add_links" do
|
describe ".add_links" do
|
||||||
|
|
Loading…
Reference in a new issue