spec/savon/soap_spec.rb in savon-0.7.6 vs spec/savon/soap_spec.rb in savon-0.7.7

- old
+ new

@@ -47,11 +47,11 @@ before do @xml_declaration = '<?xml version="1.0" encoding="UTF-8"?>' @namespace = { "xmlns:ns" => "http://example.com" } @namespace_string = 'xmlns:ns="http://example.com"' @namespaces = { "xmlns:ns" => "http://ns.example.com", "xmlns:ns2" => "http://ns2.example.com" } - + # reset to defaults Savon::SOAP.version = 1 Savon::SOAP.header = {} Savon::SOAP.namespaces = {} end @@ -135,19 +135,19 @@ end it "should merge global and per request headers defined as Hashes" do Savon::SOAP.header = { :key => "value", :key2 => "global value" } @soap.header[:key2] = "request value" - @soap.to_xml.should include( - "<env:Header><key>value</key><key2>request value</key2></env:Header>" + @soap.to_xml.should match( + /<env:Header>(<key>value<\/key><key2>request value<\/key2>|<key2>request value<\/key2><key>value<\/key>)<\/env:Header>/ ) end it "should use the :header method from a given WSSE object to include a WSSE header" do wsse = "some compliant object" wsse.stubs(:header).returns("<wsse>authentication</wsse>") - + @soap.wsse = wsse @soap.to_xml.should include("<env:Header><wsse>authentication</wsse></env:Header>") end # input tag @@ -193,9 +193,10 @@ @soap.to_xml.should include( @xml_declaration + '<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">' << '<env:Body><wsdl:authenticate></wsdl:authenticate></env:Body>' << '</env:Envelope>' - ) + ) end end -end \ No newline at end of file +end +