diff options
author | wycats <wycats@gmail.com> | 2010-04-30 11:17:58 -0700 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2010-04-30 11:17:58 -0700 |
commit | 0fe8827bf384cb99ab757236555c7af18793d515 (patch) | |
tree | a7ac2143c78964cad8ee87d9ff8a1c52abf61249 /activesupport/test/json/encoding_test.rb | |
parent | 91963e9e33eb5a28297323f1346aeb8b643e9d65 (diff) | |
parent | 6b559474fb7fae0160860fc62752da347af032b2 (diff) | |
download | rails-0fe8827bf384cb99ab757236555c7af18793d515.tar.gz rails-0fe8827bf384cb99ab757236555c7af18793d515.tar.bz2 rails-0fe8827bf384cb99ab757236555c7af18793d515.zip |
Merge branch 'master' of github.com:rails/rails
Diffstat (limited to 'activesupport/test/json/encoding_test.rb')
-rw-r--r-- | activesupport/test/json/encoding_test.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activesupport/test/json/encoding_test.rb b/activesupport/test/json/encoding_test.rb index ff95c0ca18..ac7ca96c4d 100644 --- a/activesupport/test/json/encoding_test.rb +++ b/activesupport/test/json/encoding_test.rb @@ -26,7 +26,7 @@ class TestJSONEncoding < Test::Unit::TestCase NilTests = [[ nil, %(null) ]] NumericTests = [[ 1, %(1) ], [ 2.5, %(2.5) ], - [ BigDecimal('2.5'), %("#{BigDecimal('2.5').to_s}") ]] + [ BigDecimal('2.5'), %("#{BigDecimal('2.5').to_s('F')}") ]] StringTests = [[ 'this is the <string>', %("this is the \\u003Cstring\\u003E")], [ 'a "string" with quotes & an ampersand', %("a \\"string\\" with quotes \\u0026 an ampersand") ], @@ -126,7 +126,7 @@ class TestJSONEncoding < Test::Unit::TestCase def test_hash_should_allow_key_filtering_with_except assert_equal %({"b":2}), ActiveSupport::JSON.encode({'foo' => 'bar', :b => 2, :c => 3}, :except => ['foo', :c]) end - + def test_time_to_json_includes_local_offset ActiveSupport.use_standard_json_time_format = true with_env_tz 'US/Eastern' do @@ -153,7 +153,7 @@ class TestJSONEncoding < Test::Unit::TestCase def object_keys(json_object) json_object[1..-2].scan(/([^{}:,\s]+):/).flatten.sort end - + def with_env_tz(new_tz = 'US/Eastern') old_tz, ENV['TZ'] = ENV['TZ'], new_tz yield |