diff options
author | Yves Senn <yves.senn@gmail.com> | 2015-03-06 09:04:51 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2015-03-06 09:04:51 +0100 |
commit | 081a3963ea2aab617a92874d7ef59ce98eee6a64 (patch) | |
tree | 56b4d4d672726a66ef612c34e857fb8eee45fdd3 /actionview/test/template | |
parent | 1c1bced7b17c9b0d2866f43bd2b35a1be16dbcf0 (diff) | |
download | rails-081a3963ea2aab617a92874d7ef59ce98eee6a64.tar.gz rails-081a3963ea2aab617a92874d7ef59ce98eee6a64.tar.bz2 rails-081a3963ea2aab617a92874d7ef59ce98eee6a64.zip |
`number_to_percentage` and `precision: 0` work with `NAN` and `INFINITY`.
Closes #19227.
Diffstat (limited to 'actionview/test/template')
-rw-r--r-- | actionview/test/template/number_helper_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/actionview/test/template/number_helper_test.rb b/actionview/test/template/number_helper_test.rb index b59883b760..b70b750869 100644 --- a/actionview/test/template/number_helper_test.rb +++ b/actionview/test/template/number_helper_test.rb @@ -35,6 +35,10 @@ class NumberHelperTest < ActionView::TestCase assert_equal "98a%", number_to_percentage("98a") assert_equal "NaN%", number_to_percentage(Float::NAN) assert_equal "Inf%", number_to_percentage(Float::INFINITY) + assert_equal "NaN%", number_to_percentage(Float::NAN, precision: 0) + assert_equal "Inf%", number_to_percentage(Float::INFINITY, precision: 0) + assert_equal "NaN%", number_to_percentage(Float::NAN, precision: 1) + assert_equal "Inf%", number_to_percentage(Float::INFINITY, precision: 1) end def test_number_with_delimiter |