Add test coverage for autolinking multiple URLs

This commit is contained in:
Mike Dalessio
2025-12-29 11:35:44 -05:00
parent 97d8d6a395
commit f952b953e6
+6
View File
@@ -10,6 +10,12 @@ class HtmlHelperTest < ActionView::TestCase
format_html("<p>Check this: https://example.com/</p>")
end
test "convert multiple URLs in the same string" do
assert_equal_html \
%(Visit <a href="https://foo.com/" rel="noopener noreferrer">https://foo.com/</a>. Also see <a href="https://bar.com/" rel="noopener noreferrer">https://bar.com/</a>!),
format_html("Visit https://foo.com/. Also see https://bar.com/!")
end
test "don't include punctuation in URL autolinking" do
assert_equal_html \
%(<p>Check this: <a href="https://example.com/" rel="noopener noreferrer">https://example.com/</a>!</p>),