aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/xml_serialization_test.rb
diff options
context:
space:
mode:
authorAngelo capilleri <capilleri@yahoo.com>2012-05-23 09:59:13 +0200
committerAngelo capilleri <capilleri@yahoo.com>2012-05-23 14:45:56 +0200
commit5646d65d01845adf669b9e6c4899b6ac15849bb9 (patch)
tree78c26a96418081005e94d18573b50718757a2a0a /activerecord/test/cases/xml_serialization_test.rb
parentcb92efbf0463f3b6dc0456a497556d5b414fb0e8 (diff)
downloadrails-5646d65d01845adf669b9e6c4899b6ac15849bb9.tar.gz
rails-5646d65d01845adf669b9e6c4899b6ac15849bb9.tar.bz2
rails-5646d65d01845adf669b9e6c4899b6ac15849bb9.zip
changed xml type datetime to dateTime, fixes #6328
XmlMini define the xml 'datatime', but according to http://www.w3.org/TR/xmlschema-2/#dateTime could be better change this to 'dateTime' with upper case letter 'T. So 'DateTime' and 'Time' are redefined from 'datetime' to 'dateTime' add the changing to the changelog
Diffstat (limited to 'activerecord/test/cases/xml_serialization_test.rb')
-rw-r--r--activerecord/test/cases/xml_serialization_test.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/activerecord/test/cases/xml_serialization_test.rb b/activerecord/test/cases/xml_serialization_test.rb
index 88751a72f9..12373333b0 100644
--- a/activerecord/test/cases/xml_serialization_test.rb
+++ b/activerecord/test/cases/xml_serialization_test.rb
@@ -92,7 +92,7 @@ class DefaultXmlSerializationTest < ActiveRecord::TestCase
end
def test_should_serialize_datetime
- assert_match %r{<created-at type=\"datetime\">2006-08-01T00:00:00Z</created-at>}, @xml
+ assert_match %r{<created-at type=\"dateTime\">2006-08-01T00:00:00Z</created-at>}, @xml
end
def test_should_serialize_boolean
@@ -109,7 +109,7 @@ class DefaultXmlSerializationTimezoneTest < ActiveRecord::TestCase
timezone, Time.zone = Time.zone, "Pacific Time (US & Canada)"
toy = Toy.create(:name => 'Mickey', :updated_at => Time.utc(2006, 8, 1))
- assert_match %r{<updated-at type=\"datetime\">2006-07-31T17:00:00-07:00</updated-at>}, toy.to_xml
+ assert_match %r{<updated-at type=\"dateTime\">2006-07-31T17:00:00-07:00</updated-at>}, toy.to_xml
ensure
Time.zone = timezone
end
@@ -118,7 +118,7 @@ class DefaultXmlSerializationTimezoneTest < ActiveRecord::TestCase
timezone, Time.zone = Time.zone, "Pacific Time (US & Canada)"
toy = Toy.create(:name => 'Minnie', :updated_at => Time.utc(2006, 8, 1)).reload
- assert_match %r{<updated-at type=\"datetime\">2006-07-31T17:00:00-07:00</updated-at>}, toy.to_xml
+ assert_match %r{<updated-at type=\"dateTime\">2006-07-31T17:00:00-07:00</updated-at>}, toy.to_xml
ensure
Time.zone = timezone
end
@@ -152,7 +152,7 @@ class NilXmlSerializationTest < ActiveRecord::TestCase
assert %r{<created-at (.*)></created-at>}.match(@xml)
attributes = $1
assert_match %r{nil="true"}, attributes
- assert_match %r{type="datetime"}, attributes
+ assert_match %r{type="dateTime"}, attributes
end
def test_should_serialize_boolean
@@ -188,7 +188,7 @@ class DatabaseConnectedXmlSerializationTest < ActiveRecord::TestCase
assert_equal "integer" , xml.elements["//replies-count"].attributes['type']
assert_equal written_on_in_current_timezone, xml.elements["//written-on"].text
- assert_equal "datetime" , xml.elements["//written-on"].attributes['type']
+ assert_equal "dateTime" , xml.elements["//written-on"].attributes['type']
assert_equal "david@loudthinking.com", xml.elements["//author-email-address"].text
@@ -198,7 +198,7 @@ class DatabaseConnectedXmlSerializationTest < ActiveRecord::TestCase
if current_adapter?(:SybaseAdapter)
assert_equal last_read_in_current_timezone, xml.elements["//last-read"].text
- assert_equal "datetime" , xml.elements["//last-read"].attributes['type']
+ assert_equal "dateTime" , xml.elements["//last-read"].attributes['type']
else
# Oracle enhanced adapter allows to define Date attributes in model class (see topic.rb)
assert_equal "2004-04-15", xml.elements["//last-read"].text
@@ -211,7 +211,7 @@ class DatabaseConnectedXmlSerializationTest < ActiveRecord::TestCase
assert_equal "boolean" , xml.elements["//approved"].attributes['type']
assert_equal bonus_time_in_current_timezone, xml.elements["//bonus-time"].text
- assert_equal "datetime" , xml.elements["//bonus-time"].attributes['type']
+ assert_equal "dateTime" , xml.elements["//bonus-time"].attributes['type']
end
end