diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-03 11:02:42 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-11-03 11:02:42 -0700 |
commit | 63625388154043dd6cde755f62c095dad87ad173 (patch) | |
tree | dddbe0649873c1841cdaade80ffb6a8bfacf5560 /activesupport/test | |
parent | ea0faa2055fbbe6ac9ebe960ddf4bea8adda287a (diff) | |
download | rails-63625388154043dd6cde755f62c095dad87ad173.tar.gz rails-63625388154043dd6cde755f62c095dad87ad173.tar.bz2 rails-63625388154043dd6cde755f62c095dad87ad173.zip |
add more tests surrounding camlize in xmlmini, refactor rename_key()
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/test_xml_mini.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activesupport/test/test_xml_mini.rb b/activesupport/test/test_xml_mini.rb index b14a3e1546..309fa234bf 100644 --- a/activesupport/test/test_xml_mini.rb +++ b/activesupport/test/test_xml_mini.rb @@ -14,6 +14,14 @@ class XmlMiniTest < Test::Unit::TestCase assert_equal "my_key", ActiveSupport::XmlMini.rename_key("my_key", :dasherize => false) end + def test_rename_key_camelizes_with_camelize_false + assert_equal "my_key", ActiveSupport::XmlMini.rename_key("my_key", :camelize => false) + end + + def test_rename_key_camelizes_with_camelize_nil + assert_equal "my_key", ActiveSupport::XmlMini.rename_key("my_key", :camelize => nil) + end + def test_rename_key_camelizes_with_camelize_true assert_equal "MyKey", ActiveSupport::XmlMini.rename_key("my_key", :camelize => true) end @@ -22,6 +30,10 @@ class XmlMiniTest < Test::Unit::TestCase assert_equal "myKey", ActiveSupport::XmlMini.rename_key("my_key", :camelize => :lower) end + def test_rename_key_lower_camelizes_with_camelize_upper + assert_equal "MyKey", ActiveSupport::XmlMini.rename_key("my_key", :camelize => :upper) + end + def test_rename_key_does_not_dasherize_leading_underscores assert_equal "_id", ActiveSupport::XmlMini.rename_key("_id") end |