aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/number_helper_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/template/number_helper_test.rb')
-rw-r--r--actionpack/test/template/number_helper_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/actionpack/test/template/number_helper_test.rb b/actionpack/test/template/number_helper_test.rb
index 8d679aac1d..37ce3cf6b6 100644
--- a/actionpack/test/template/number_helper_test.rb
+++ b/actionpack/test/template/number_helper_test.rb
@@ -251,6 +251,11 @@ class NumberHelperTest < ActionView::TestCase
assert_equal '4.5 tens', number_to_human(45, :units => {:unit => "", :ten => ' tens '})
end
+ def test_number_to_human_with_custom_units_that_are_missing_the_needed_key
+ assert_equal '123', number_to_human(123, :units => {:thousand => 'k'})
+ assert_equal '123', number_to_human(123, :units => {})
+ end
+
def test_number_to_human_with_custom_format
assert_equal '123 times Thousand', number_to_human(123456, :format => "%n times %u")
volume = {:unit => "ml", :thousand => "lt", :million => "m3"}