From 00a1766ad12cc3f4cccaf26e5b2acc0ca6e7cb93 Mon Sep 17 00:00:00 2001 From: August Lilleaas Date: Sun, 30 May 2010 02:54:36 +0200 Subject: [PATCH] Adding test case for hashes with time objects in it where to_json is called on it. --- activesupport/test/json/encoding_test.rb | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/activesupport/test/json/encoding_test.rb b/activesupport/test/json/encoding_test.rb index a8ecf4e..2c092ae 100644 --- a/activesupport/test/json/encoding_test.rb +++ b/activesupport/test/json/encoding_test.rb @@ -138,6 +138,10 @@ class TestJSONEncoding < Test::Unit::TestCase ActiveSupport.use_standard_json_time_format = false end + def test_hash_with_time + assert_equal "{'date':'2008/05/17 00:00:00 +0000'}", {:date => Time.utc(2008, 5, 17)}.to_json + end + def test_nested_hash_with_float assert_nothing_raised do hash = { -- 1.7.1