diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2013-11-02 15:40:16 -0700 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2013-11-02 15:40:16 -0700 |
commit | 423249504a2b468d7a273cbe6accf4f21cb0e643 (patch) | |
tree | b8794f5ff4660ad7d0959bff9f9601af11cd50b0 /activesupport/test/core_ext/numeric_ext_test.rb | |
parent | db41eb8a6ea88b854bf5cd11070ea4245e1639c5 (diff) | |
download | rails-423249504a2b468d7a273cbe6accf4f21cb0e643.tar.gz rails-423249504a2b468d7a273cbe6accf4f21cb0e643.tar.bz2 rails-423249504a2b468d7a273cbe6accf4f21cb0e643.zip |
Added Numeric#in_milliseconds, like 1.hour.in_milliseconds, so we can feed them to JavaScript functions like getTime().
Diffstat (limited to 'activesupport/test/core_ext/numeric_ext_test.rb')
-rw-r--r-- | activesupport/test/core_ext/numeric_ext_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/numeric_ext_test.rb b/activesupport/test/core_ext/numeric_ext_test.rb index 1da72eb17d..23bbb8d7d2 100644 --- a/activesupport/test/core_ext/numeric_ext_test.rb +++ b/activesupport/test/core_ext/numeric_ext_test.rb @@ -440,4 +440,8 @@ class NumericExtFormattingTest < ActiveSupport::TestCase assert_equal BigDecimal, BigDecimal("1000010").class assert_equal '1 Million', BigDecimal("1000010").to_s(:human) end + + def test_in_milliseconds + assert_equal 10_000, 10.seconds.in_milliseconds + end end |