aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/inflector_test_cases.rb
diff options
context:
space:
mode:
authorMubashir Hanif <mubashirhanif93@gmail.com>2016-08-07 17:27:47 +0500
committerMubashir Hanif <mubashirhanif93@gmail.com>2017-03-21 22:55:17 +0100
commitf0c8f1b0856592541f248a081cabcbd9aa890c28 (patch)
tree9bdcdfc00f36e5a8da5328ad6cb9c5542a1d4112 /activesupport/test/inflector_test_cases.rb
parent6d6249b1c1abda4f62fafcc42a7ece570c8da7e9 (diff)
downloadrails-f0c8f1b0856592541f248a081cabcbd9aa890c28.tar.gz
rails-f0c8f1b0856592541f248a081cabcbd9aa890c28.tar.bz2
rails-f0c8f1b0856592541f248a081cabcbd9aa890c28.zip
Added options hash to titleize method and keep_id_suffix option to humanize
some documentation remove extra whitespace. Added id in the middle test case and corrected some testcases. Some Coding standard guidelines corrections as suggested by codeclimate. Some more corrections suggested by codeclimate.
Diffstat (limited to 'activesupport/test/inflector_test_cases.rb')
-rw-r--r--activesupport/test/inflector_test_cases.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/activesupport/test/inflector_test_cases.rb b/activesupport/test/inflector_test_cases.rb
index b660987d92..20a1c5b35d 100644
--- a/activesupport/test/inflector_test_cases.rb
+++ b/activesupport/test/inflector_test_cases.rb
@@ -248,12 +248,27 @@ module InflectorTestCases
"_external_id" => "External"
}
+ UnderscoreToHumanWithKeepIdSuffix = {
+ "this_is_a_string_ending_with_id" => "This is a string ending with id",
+ "employee_id" => "Employee id",
+ "employee_id_something_else" => "Employee id something else",
+ "underground" => "Underground",
+ "_id" => "Id",
+ "_external_id" => "External id"
+ }
+
UnderscoreToHumanWithoutCapitalize = {
"employee_salary" => "employee salary",
"employee_id" => "employee",
"underground" => "underground"
}
+ MixtureToTitleCaseWithKeepIdSuffix = {
+ "this_is_a_string_ending_with_id" => "This Is A String Ending With Id",
+ "EmployeeId" => "Employee Id",
+ "Author Id" => "Author Id"
+ }
+
MixtureToTitleCase = {
"active_record" => "Active Record",
"ActiveRecord" => "Active Record",