Fix UTF-8 header and add test

This commit is contained in:
bootstraponline
2012-11-29 23:47:25 -07:00
parent f929df0419
commit 4ee94a6574
2 changed files with 19 additions and 4 deletions
+15 -1
View File
@@ -38,10 +38,24 @@ context "Frontend" do
assert_equal 'm-plus-f', 'μ†ℱ'.to_url
end
test 'utf-8 kcode' do
test "utf-8 kcode" do
assert_equal 'μ†ℱ'.scan(/./), ["μ", "", ""]
end
test "UTF-8 headers href preserved" do
page = 'utfh1'
text = '한글'
# don't use h1 or it will be promoted to replace file name
# which doesn't generate a normal header link
@wiki.write_page(page, :markdown, '## ' + text,
{ :name => 'user1', :email => 'user1' });
get page
assert_match /<h2>#{text}<a class="anchor" id="#{text}" href="##{text}"><\/a><\/h2>/, last_response.body
end
test "retain edit information" do
page1 = 'page1'
user1 = 'user1'