diff options
author | Josh Kalderimis <josh.kalderimis@gmail.com> | 2011-02-11 16:47:25 +0100 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2011-02-11 13:54:57 -0200 |
commit | b17d8d727fb510ad8b6eb4302984d290dc2e53b0 (patch) | |
tree | f482fbd339de6f1bbdbf38d9a07c119f6e18d119 /activesupport/test | |
parent | f23bf7dbdbc0e0590083f0f288aa24f5b830e685 (diff) | |
download | rails-b17d8d727fb510ad8b6eb4302984d290dc2e53b0.tar.gz rails-b17d8d727fb510ad8b6eb4302984d290dc2e53b0.tar.bz2 rails-b17d8d727fb510ad8b6eb4302984d290dc2e53b0.zip |
Fixes an issue when decoding a json string which looks like a date but is invalid. This DateTime parse error is now caught and the original string is instead passed back [#6286 state:resolved]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'activesupport/test')
-rw-r--r-- | activesupport/test/json/decoding_test.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/activesupport/test/json/decoding_test.rb b/activesupport/test/json/decoding_test.rb index 436861baad..77f24f0de3 100644 --- a/activesupport/test/json/decoding_test.rb +++ b/activesupport/test/json/decoding_test.rb @@ -19,6 +19,8 @@ class TestJSONDecoding < ActiveSupport::TestCase %({"a": "2007-01-01 01:12:34 Z"}) => {'a' => Time.utc(2007, 1, 1, 1, 12, 34)}, # no time zone %({"a": "2007-01-01 01:12:34"}) => {'a' => "2007-01-01 01:12:34"}, + # invalid date + %({"a": "1089-10-40"}) => {'a' => "1089-10-40"}, # needs to be *exact* %({"a": " 2007-01-01 01:12:34 Z "}) => {'a' => " 2007-01-01 01:12:34 Z "}, %({"a": "2007-01-01 : it's your birthday"}) => {'a' => "2007-01-01 : it's your birthday"}, |