aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorJosh Kalderimis <josh.kalderimis@gmail.com>2011-02-12 16:29:17 +0100
committerSantiago Pastorino and Emilio Tagua <santiago+emilioe@wyeworks.com>2011-02-12 13:30:30 -0200
commite8c870726a67a27965b2a5333a5ecf450d4f458f (patch)
tree8518feae8c2d58b2c29bb3e2fb69ee6206a8a6e1 /activesupport/test
parent5b0695a8cba1f2f2dc88cb9777fc6e7bbe24da01 (diff)
downloadrails-e8c870726a67a27965b2a5333a5ecf450d4f458f.tar.gz
rails-e8c870726a67a27965b2a5333a5ecf450d4f458f.tar.bz2
rails-e8c870726a67a27965b2a5333a5ecf450d4f458f.zip
Updated the json date regex to recognize xmlschema formatted date times during json decoding. [#3031 state:resolved]
Signed-off-by: Santiago Pastorino and Emilio Tagua <santiago+emilioe@wyeworks.com>
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/json/decoding_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/test/json/decoding_test.rb b/activesupport/test/json/decoding_test.rb
index 77f24f0de3..24d9f88c09 100644
--- a/activesupport/test/json/decoding_test.rb
+++ b/activesupport/test/json/decoding_test.rb
@@ -21,6 +21,10 @@ class TestJSONDecoding < ActiveSupport::TestCase
%({"a": "2007-01-01 01:12:34"}) => {'a' => "2007-01-01 01:12:34"},
# invalid date
%({"a": "1089-10-40"}) => {'a' => "1089-10-40"},
+ # xmlschema date notation
+ %({"a": "2009-08-10T19:01:02Z"}) => {'a' => Time.utc(2009, 8, 10, 19, 1, 2)},
+ %({"a": "2009-08-10T19:01:02+02:00"}) => {'a' => Time.utc(2009, 8, 10, 17, 1, 2)},
+ %({"a": "2009-08-10T19:01:02-05:00"}) => {'a' => Time.utc(2009, 8, 11, 00, 1, 2)},
# 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"},