Skip to content

Commit b13ed2f

Browse files
committed
update the test to reflect our new understanding
1 parent 67ad71e commit b13ed2f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/html/pipeline/toc_filter_test.rb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,15 @@ def test_all_header_tags_are_found_when_adding_anchors
4444
assert_equal 6, doc.search('a').size
4545
end
4646

47-
def test_anchors_with_non_english_stuff
47+
def test_anchors_with_utf8_characters
4848
orig = %(<h1>日本語</h1>
4949
<h1>Русский</h1)
5050

51-
names = TocFilter.call(orig).search('a').map { |a| a['name'] }
52-
assert_includes "日本語", names
53-
assert_includes "Русский", names
51+
rendered_h1s = TocFilter.call(orig).search('h1').map(&:to_s)
52+
53+
assert_equal "<h1>\n<a name=\"%E6%97%A5%E6%9C%AC%E8%AA%9E\" class=\"anchor\" href=\"#%E6%97%A5%E6%9C%AC%E8%AA%9E\"><span class=\"octicon octicon-link\"></span></a>日本語</h1>",
54+
rendered_h1s[0]
55+
assert_equal "<h1>\n<a name=\"%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9\" class=\"anchor\" href=\"#%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9\"><span class=\"octicon octicon-link\"></span></a>Русский</h1>",
56+
rendered_h1s[1]
5457
end
5558
end

0 commit comments

Comments
 (0)