spec/public/to_xml_spec.rb in dm-serializer-0.9.9 vs spec/public/to_xml_spec.rb in dm-serializer-0.9.10
- old
+ new
@@ -57,9 +57,15 @@
DataMapper::Serialize::XMLSerializers::SERIALIZER = DataMapper::Serialize::XMLSerializers::const_get(lib)
end
it_should_behave_like "A serialization method"
+ it "should not include the XML prologue, so that the result can be embedded in other XML documents" do
+ planet = Planet.new
+ xml = planet.to_xml(:element_name => "aplanet")
+ xml.starts_with?("<?xml").should == false
+ end
+
describe ':element_name option for Resource' do
it 'should be used as the root node name by #to_xml' do
planet = Planet.new
xml = planet.to_xml(:element_name => "aplanet")
REXML::Document.new(xml).elements[1].name.should == "aplanet"