Skip to content

Commit

Permalink
Merge branch 'new_soap_fault_spec' of git://github.com/DavidEGrayson/…
Browse files Browse the repository at this point in the history
…savon into DavidEGrayson-new_soap_fault_spec
  • Loading branch information
rubiii committed Apr 20, 2013
2 parents 18845e9 + 43f2fb9 commit ed6e9c1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spec/savon/soap_fault_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
describe Savon::SOAPFault do
let(:soap_fault) { Savon::SOAPFault.new new_response(:body => Fixture.response(:soap_fault)), nori }
let(:soap_fault2) { Savon::SOAPFault.new new_response(:body => Fixture.response(:soap_fault12)), nori }
let(:soap_fault_nc) { Savon::SOAPFault.new new_response(:body => Fixture.response(:soap_fault)), nori_no_convert }
let(:soap_fault_nc2) { Savon::SOAPFault.new new_response(:body => Fixture.response(:soap_fault12)), nori_no_convert }
let(:another_soap_fault) { Savon::SOAPFault.new new_response(:body => Fixture.response(:another_soap_fault)), nori }
let(:no_fault) { Savon::SOAPFault.new new_response, nori }

let(:nori) { Nori.new(:strip_namespaces => true, :convert_tags_to => lambda { |tag| tag.snakecase.to_sym }) }
let(:nori_no_convert) { Nori.new(:strip_namespaces => true, :convert_tags_to => nil) }

it "inherits from Savon::Error" do
expect(Savon::SOAPFault.ancestors).to include(Savon::Error)
Expand Down Expand Up @@ -52,6 +55,14 @@
it "returns a SOAP fault message (with different namespaces)" do
expect(another_soap_fault.send method).to eq("(ERR_NO_SESSION) Wrong session message")
end

it "works even if the keys are different in a SOAP 1.1 fault message" do
soap_fault_nc.send method
end

it "works even if the keys are different in a SOAP 1.2 fault message" do
soap_fault_nc2.send method
end
end
end

Expand Down Expand Up @@ -82,6 +93,10 @@

expect(soap_fault2.to_hash).to eq(expected)
end

it "works even if the keys are different" do
soap_fault_nc2.to_hash
end
end

def new_response(options = {})
Expand Down

0 comments on commit ed6e9c1

Please sign in to comment.