From 381210daa0b8db26be85841b8ccf889d0ef67d75 Mon Sep 17 00:00:00 2001 From: Amos King Date: Fri, 22 Aug 2008 13:31:13 +0100 Subject: camelize(:lower) should always downcase first character. [#696 state:resolved] Signed-off-by: Pratik Naik --- activesupport/test/core_ext/string_ext_test.rb | 4 ++++ activesupport/test/inflector_test.rb | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'activesupport/test') diff --git a/activesupport/test/core_ext/string_ext_test.rb b/activesupport/test/core_ext/string_ext_test.rb index 19a30f1730..c9f959ef32 100644 --- a/activesupport/test/core_ext/string_ext_test.rb +++ b/activesupport/test/core_ext/string_ext_test.rb @@ -32,6 +32,10 @@ class StringInflectionsTest < Test::Unit::TestCase end end + def test_camelize_lower + assert_equal('capital', 'Capital'.camelize(:lower)) + end + def test_underscore CamelToUnderscore.each do |camel, underscore| assert_equal(underscore, camel.underscore) diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb index 6c0c14e866..b2fad4a9bc 100644 --- a/activesupport/test/inflector_test.rb +++ b/activesupport/test/inflector_test.rb @@ -46,6 +46,10 @@ class InflectorTest < Test::Unit::TestCase end end + def test_camelize_with_lower_downcases_the_first_letter + assert_equal('capital', ActiveSupport::Inflector.camelize('Capital', false)) + end + def test_underscore CamelToUnderscore.each do |camel, underscore| assert_equal(underscore, ActiveSupport::Inflector.underscore(camel)) -- cgit v1.2.3