require File.join(File.dirname(__FILE__), "..", "spec_helper") describe ApricotEatsGorilla do describe "soap_envelope" do before { ApricotEatsGorilla.sort_keys = true } it "returns an empty SOAP envelope with a SOAP 1.1 envelope namespace" do ApricotEatsGorilla.soap_envelope.should == '' << '' end it "returns a SOAP envelope with a custom namespace and body content" do ApricotEatsGorilla.soap_envelope(:wsdl => "http://example.com") do "123" end.should == '' << '' << '123' end it "does not change an already defined SOAP envelope namespace" do ApricotEatsGorilla.soap_envelope(:env => "http://example.com").should == '' << '' << '' end it "sets the SOAP envelope namespace for SOAP version 1.2 if requested" do ApricotEatsGorilla.soap_envelope({}, {}, 2).should == '' << '' << '' end it "does not set a SOAP envelope namespace in case of an invalid SOAP version" do ApricotEatsGorilla.soap_envelope({}, {}, 123).should == '' end end end