diff options
author | Travis Briggs <briggs.travis@gmail.com> | 2009-03-18 21:51:26 -0400 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-05-17 19:02:50 +0200 |
commit | 98eaa2c6834e418959f2a1a18421e4811167e03b (patch) | |
tree | 572e6d9cf43af56feb7e28b94f8711d99b61ecbd /actionpack/test/template | |
parent | e41984c5f7f38b62c05dfcb54940bf51f6961aeb (diff) | |
download | rails-98eaa2c6834e418959f2a1a18421e4811167e03b.tar.gz rails-98eaa2c6834e418959f2a1a18421e4811167e03b.tar.bz2 rails-98eaa2c6834e418959f2a1a18421e4811167e03b.zip |
Ensure number_to_human_size does not strip zeros from the end [#1763 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/number_helper_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/actionpack/test/template/number_helper_test.rb b/actionpack/test/template/number_helper_test.rb index 29cb60fd73..b6542ef29d 100644 --- a/actionpack/test/template/number_helper_test.rb +++ b/actionpack/test/template/number_helper_test.rb @@ -118,6 +118,10 @@ class NumberHelperTest < ActionView::TestCase assert_equal '1.01 KB', number_to_human_size(1.0123.kilobytes, :precision => 2) assert_equal '1.01 KB', number_to_human_size(1.0100.kilobytes, :precision => 4) assert_equal '10 KB', number_to_human_size(10.000.kilobytes, :precision => 4) + assert_equal '1 TB', number_to_human_size(1234567890123, :precision => 0) + assert_equal '500 MB', number_to_human_size(524288000, :precision=>0) + assert_equal '40 KB', number_to_human_size(41010, :precision => 0) + assert_equal '40 KB', number_to_human_size(41100, :precision => 0) end def test_number_to_human_size_with_custom_delimiter_and_separator |