mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
fix interplay of humanize and html_escape
This commit is contained in:
parent
84fe7b7db6
commit
26698fb91d
2 changed files with 5 additions and 1 deletions
|
@ -117,7 +117,7 @@ module ActiveSupport
|
||||||
result.gsub!(/([a-z\d]*)/i) { |match|
|
result.gsub!(/([a-z\d]*)/i) { |match|
|
||||||
"#{inflections.acronyms[match] || match.downcase}"
|
"#{inflections.acronyms[match] || match.downcase}"
|
||||||
}
|
}
|
||||||
result.gsub!(/^\w/) { $&.upcase } if options.fetch(:capitalize, true)
|
result.gsub!(/^\w/) { |match| match.upcase } if options.fetch(:capitalize, true)
|
||||||
result
|
result
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -161,6 +161,10 @@ class StringInflectionsTest < ActiveSupport::TestCase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_humanize_with_html_escape
|
||||||
|
assert_equal 'Hello', ERB::Util.html_escape("hello").humanize
|
||||||
|
end
|
||||||
|
|
||||||
def test_ord
|
def test_ord
|
||||||
assert_equal 97, 'a'.ord
|
assert_equal 97, 'a'.ord
|
||||||
assert_equal 97, 'abc'.ord
|
assert_equal 97, 'abc'.ord
|
||||||
|
|
Loading…
Reference in a new issue