diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-10-05 09:43:24 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-10-05 09:43:24 +0000 |
commit | 58a5eef53eee7768d68cc034a1563914d21a68cb (patch) | |
tree | e2e6dc48d8d5359acb72629e8ed805609c370345 /activesupport/test | |
parent | 335c15005db47afe429d2ee27102dd646e3d43f6 (diff) | |
download | rails-58a5eef53eee7768d68cc034a1563914d21a68cb.tar.gz rails-58a5eef53eee7768d68cc034a1563914d21a68cb.tar.bz2 rails-58a5eef53eee7768d68cc034a1563914d21a68cb.zip |
Disambiguate Time, Date, and DateTime#to_json formatting. Closes #9750.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7746 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/test')
-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 dee5b928d3..c42832b371 100644 --- a/activesupport/test/json/encoding_test.rb +++ b/activesupport/test/json/encoding_test.rb @@ -29,9 +29,9 @@ class TestJSONEncoding < Test::Unit::TestCase [ ActiveSupport::JSON::Variable.new('alert("foo")'), 'alert("foo")']] RegexpTests = [[ /^a/, '/^a/' ], [/^\w{1,2}[a-z]+/ix, '/^\\w{1,2}[a-z]+/ix']] - DateTests = [[ Date.new(2005,1,1), %("01/01/2005") ]] - TimeTests = [[ Time.at(0), %("#{Time.at(0).strftime('%m/%d/%Y %H:%M:%S %Z')}") ]] - DateTimeTests = [[ DateTime.new(0), %("#{DateTime.new(0).strftime('%m/%d/%Y %H:%M:%S %Z')}") ]] + DateTests = [[ Date.new(2005,2,1), %("2005/02/01") ]] + TimeTests = [[ Time.utc(2005,2,1,15,15,10), %("2005/02/01 15:15:10 +0000") ]] + DateTimeTests = [[ DateTime.civil(2005,2,1,15,15,10), %("2005/02/01 15:15:10 +0000") ]] constants.grep(/Tests$/).each do |class_tests| define_method("test_#{class_tests[0..-6].downcase}") do |