diff options
Diffstat (limited to 'actionview/test/template/number_helper_test.rb')
-rw-r--r-- | actionview/test/template/number_helper_test.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/actionview/test/template/number_helper_test.rb b/actionview/test/template/number_helper_test.rb index adb888319d..b59883b760 100644 --- a/actionview/test/template/number_helper_test.rb +++ b/actionview/test/template/number_helper_test.rb @@ -48,6 +48,7 @@ class NumberHelperTest < ActionView::TestCase assert_equal "-111.235", number_with_precision(-111.2346) assert_equal "111.00", number_with_precision(111, precision: 2) assert_equal "0.00100", number_with_precision(0.001, precision: 5) + assert_equal "3.33", number_with_precision(Rational(10, 3), precision: 2) end def test_number_to_human_size @@ -113,6 +114,8 @@ class NumberHelperTest < ActionView::TestCase I18n.backend.store_translations 'ts', :custom_units_for_number_to_human => {:mili => "mm", :centi => "cm", :deci => "dm", :unit => "m", :ten => "dam", :hundred => "hm", :thousand => "km"} assert_equal "1.01 cm", number_to_human(0.0101, :locale => 'ts', :units => :custom_units_for_number_to_human) + ensure + I18n.reload! end def test_number_helpers_outputs_are_html_safe |