Skip to content
Browse files

Fix AR tests due to builder change with nil values / empty strings

Check 0180e09 for more reasoning about
that.
  • Loading branch information...
1 parent 29fe065 commit ba4a6c296e2283501494e1608be238f30444e1fc @carlosantoniodasilva carlosantoniodasilva committed
Showing with 6 additions and 6 deletions.
  1. +6 −6 activerecord/test/cases/xml_serialization_test.rb
View
12 activerecord/test/cases/xml_serialization_test.rb
@@ -185,18 +185,18 @@ def setup
end
def test_should_serialize_string
- assert_match %r{<name nil="true"></name>}, @xml
+ assert_match %r{<name nil="true"/>}, @xml
end
def test_should_serialize_integer
- assert %r{<age (.*)></age>}.match(@xml)
+ assert %r{<age (.*)/>}.match(@xml)
attributes = $1
assert_match %r{nil="true"}, attributes
assert_match %r{type="integer"}, attributes
end
def test_should_serialize_binary
- assert %r{<avatar (.*)></avatar>}.match(@xml)
+ assert %r{<avatar (.*)/>}.match(@xml)
attributes = $1
assert_match %r{type="binary"}, attributes
assert_match %r{encoding="base64"}, attributes
@@ -204,21 +204,21 @@ def test_should_serialize_binary
end
def test_should_serialize_datetime
- assert %r{<created-at (.*)></created-at>}.match(@xml)
+ assert %r{<created-at (.*)/>}.match(@xml)
attributes = $1
assert_match %r{nil="true"}, attributes
assert_match %r{type="dateTime"}, attributes
end
def test_should_serialize_boolean
- assert %r{<awesome (.*)></awesome>}.match(@xml)
+ assert %r{<awesome (.*)/>}.match(@xml)
attributes = $1
assert_match %r{type="boolean"}, attributes
assert_match %r{nil="true"}, attributes
end
def test_should_serialize_yaml
- assert_match %r{<preferences nil=\"true\"></preferences>}, @xml
+ assert_match %r{<preferences nil=\"true\"/>}, @xml
end
end

0 comments on commit ba4a6c2

Please sign in to comment.
Something went wrong with that request. Please try again.