aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2010-12-29 22:20:14 +0000
committerPratik Naik <pratiknaik@gmail.com>2010-12-29 22:20:14 +0000
commit0ac66caac5581c4793d120c8ad4a2cf4137f6ce2 (patch)
tree6de0b3cdd589c648a525c2c3d6e1878c9bf4df78 /activesupport/test/core_ext
parent43433b3fb4b9c054e0bcaaa1f7456b3fececd268 (diff)
downloadrails-0ac66caac5581c4793d120c8ad4a2cf4137f6ce2.tar.gz
rails-0ac66caac5581c4793d120c8ad4a2cf4137f6ce2.tar.bz2
rails-0ac66caac5581c4793d120c8ad4a2cf4137f6ce2.zip
Fix Duration#to_json
Diffstat (limited to 'activesupport/test/core_ext')
-rw-r--r--activesupport/test/core_ext/duration_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/duration_test.rb b/activesupport/test/core_ext/duration_test.rb
index bb453b8d7f..6a01eeed6b 100644
--- a/activesupport/test/core_ext/duration_test.rb
+++ b/activesupport/test/core_ext/duration_test.rb
@@ -1,5 +1,6 @@
require 'abstract_unit'
require 'active_support/time'
+require 'active_support/json'
class DurationTest < ActiveSupport::TestCase
def test_is_a
@@ -138,6 +139,10 @@ class DurationTest < ActiveSupport::TestCase
assert_equal counter, 60
end
+ def test_to_json
+ assert_equal '172800', 2.days.to_json
+ end
+
protected
def with_env_tz(new_tz = 'US/Eastern')
old_tz, ENV['TZ'] = ENV['TZ'], new_tz