Fix utf8 test
This commit is contained in:
+4
-3
@@ -10,10 +10,10 @@ Gem::Specification.new do |s|
|
|||||||
s.rubyforge_project = 'gollum'
|
s.rubyforge_project = 'gollum'
|
||||||
s.license = 'MIT'
|
s.license = 'MIT'
|
||||||
|
|
||||||
s.summary = "A simple, Git-powered wiki."
|
s.summary = 'A simple, Git-powered wiki.'
|
||||||
s.description = "A simple, Git-powered wiki with a sweet API and local frontend."
|
s.description = 'A simple, Git-powered wiki with a sweet API and local frontend.'
|
||||||
|
|
||||||
s.authors = ["Tom Preston-Werner", "Rick Olson"]
|
s.authors = ['Tom Preston-Werner', 'Rick Olson']
|
||||||
s.email = 'tom@github.com'
|
s.email = 'tom@github.com'
|
||||||
s.homepage = 'http://github.com/gollum/gollum'
|
s.homepage = 'http://github.com/gollum/gollum'
|
||||||
|
|
||||||
@@ -33,6 +33,7 @@ Gem::Specification.new do |s|
|
|||||||
s.add_development_dependency 'rack-test', '~> 0.6.2'
|
s.add_development_dependency 'rack-test', '~> 0.6.2'
|
||||||
s.add_development_dependency 'shoulda', '~> 3.4.0'
|
s.add_development_dependency 'shoulda', '~> 3.4.0'
|
||||||
s.add_development_dependency 'minitest-reporters', '~> 0.14.16'
|
s.add_development_dependency 'minitest-reporters', '~> 0.14.16'
|
||||||
|
s.add_development_dependency 'twitter_cldr', '~> 2.4.2'
|
||||||
|
|
||||||
# = MANIFEST =
|
# = MANIFEST =
|
||||||
s.files = %w[
|
s.files = %w[
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ require 'shoulda'
|
|||||||
require 'mocha/setup'
|
require 'mocha/setup'
|
||||||
require 'fileutils'
|
require 'fileutils'
|
||||||
require 'minitest/reporters'
|
require 'minitest/reporters'
|
||||||
|
require 'twitter_cldr'
|
||||||
|
|
||||||
# Silence locale validation warning
|
# Silence locale validation warning
|
||||||
require 'i18n'
|
require 'i18n'
|
||||||
|
|||||||
+9
-2
@@ -63,9 +63,13 @@ context "Frontend" do
|
|||||||
assert_match /<pre><code>one\ntwo\nthree\nfour\n<\/code><\/pre>\n/m, last_response.body
|
assert_match /<pre><code>one\ntwo\nthree\nfour\n<\/code><\/pre>\n/m, last_response.body
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def nfd utf8
|
||||||
|
TwitterCldr::Normalization::NFD.normalize utf8
|
||||||
|
end
|
||||||
|
|
||||||
test "UTF-8 headers href preserved" do
|
test "UTF-8 headers href preserved" do
|
||||||
page = 'utfh1'
|
page = 'utfh1'
|
||||||
text = '한글'
|
text = nfd('한글')
|
||||||
|
|
||||||
# don't use h1 or it will be promoted to replace file name
|
# don't use h1 or it will be promoted to replace file name
|
||||||
# which doesn't generate a normal header link
|
# which doesn't generate a normal header link
|
||||||
@@ -74,7 +78,10 @@ context "Frontend" do
|
|||||||
|
|
||||||
get page
|
get page
|
||||||
|
|
||||||
assert_match /<h2>#{text}<a class="anchor" id="#{text}" href="##{text}"><\/a><\/h2>/, last_response.body
|
expected = "<h2><a class=\"anchor\" id=\"#{text}\" href=\"##{text}\"><i class=\"fa fa-link\"></i></a>#{text}</h2>"
|
||||||
|
actual = nfd(last_response.body)
|
||||||
|
|
||||||
|
assert_match /#{expected}/, actual
|
||||||
end
|
end
|
||||||
|
|
||||||
test "retain edit information" do
|
test "retain edit information" do
|
||||||
|
|||||||
Reference in New Issue
Block a user