diff options
author | José Valim <jose.valim@gmail.com> | 2012-01-25 05:15:09 -0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-01-25 05:15:09 -0800 |
commit | a3b36438861934fdacbcff318bd692cbc5d73268 (patch) | |
tree | 2aa77c41c5dd652b790d5dca1e46890931b562b9 /actionpack/test | |
parent | a6aea14e69b56529b66eeaa00bf9df18da68b8da (diff) | |
parent | 74fabdf6c4c00827c657b4d6cef9ae6b96d3d0d2 (diff) | |
download | rails-a3b36438861934fdacbcff318bd692cbc5d73268.tar.gz rails-a3b36438861934fdacbcff318bd692cbc5d73268.tar.bz2 rails-a3b36438861934fdacbcff318bd692cbc5d73268.zip |
Merge pull request #4667 from carlosantoniodasilva/av-number-helper
Action View number helpers improvements
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/number_helper_test.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/actionpack/test/template/number_helper_test.rb b/actionpack/test/template/number_helper_test.rb index ca897a48cc..482d953907 100644 --- a/actionpack/test/template/number_helper_test.rb +++ b/actionpack/test/template/number_helper_test.rb @@ -268,6 +268,31 @@ class NumberHelperTest < ActionView::TestCase assert_nil number_to_human(nil) end + def test_number_helpers_do_not_mutate_options_hash + options = { 'raise' => true } + + number_to_phone(1, options) + assert_equal({ 'raise' => true }, options) + + number_to_currency(1, options) + assert_equal({ 'raise' => true }, options) + + number_to_percentage(1, options) + assert_equal({ 'raise' => true }, options) + + number_with_delimiter(1, options) + assert_equal({ 'raise' => true }, options) + + number_with_precision(1, options) + assert_equal({ 'raise' => true }, options) + + number_to_human_size(1, options) + assert_equal({ 'raise' => true }, options) + + number_to_human(1, options) + assert_equal({ 'raise' => true }, options) + end + def test_number_helpers_should_return_non_numeric_param_unchanged assert_equal("+1-x x 123", number_to_phone("x", :country_code => 1, :extension => 123)) assert_equal("x", number_to_phone("x")) |