aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorAndrew White <andrew.white@unboxed.co>2017-03-06 17:40:15 +0000
committerAndrew White <andrew.white@unboxed.co>2017-03-06 17:51:03 +0000
commit48b37f127fb44b787ae6c0710982d7949b14454f (patch)
treed3def9f511624a1c9c376590f4a1c7837ef370f2 /activesupport/test
parent53692535896437f7c67093820f09440c672fa215 (diff)
downloadrails-48b37f127fb44b787ae6c0710982d7949b14454f.tar.gz
rails-48b37f127fb44b787ae6c0710982d7949b14454f.tar.bz2
rails-48b37f127fb44b787ae6c0710982d7949b14454f.zip
Update `titlelize` regex to allow apostrophes
In 4b685aa the regex in `titlelize` was updated to not match apostrophes to better reflect the nature of the transformation. Unfortunately this had the side effect of breaking capitalization on the first word of a sub-string, e.g: >> "This was 'fake news'".titleize => "This Was 'fake News'" This is fixed by extending the look-behind to also check for a word character on the other side of the apostrophe. Fixes #28312.
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/inflector_test_cases.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activesupport/test/inflector_test_cases.rb b/activesupport/test/inflector_test_cases.rb
index b660987d92..f3352e3301 100644
--- a/activesupport/test/inflector_test_cases.rb
+++ b/activesupport/test/inflector_test_cases.rb
@@ -271,6 +271,7 @@ module InflectorTestCases
"¿por qué?" => "¿Por Qué?",
"Fred’s" => "Fred’s",
"Fred`s" => "Fred`s",
+ "this was 'fake news'" => "This Was 'Fake News'",
ActiveSupport::SafeBuffer.new("confirmation num") => "Confirmation Num"
}