Sha256: 7683c1b2343dd5b396414a9c62cb8d8755eb9ae8b3871c4176100838bcb67173
Contents?: true
Size: 1.77 KB
Versions: 1
Compression:
Stored size: 1.77 KB
Contents
module SoapResponseFixture def some_response_hash { :authentication => { :user => "example", :password => "secret" }, :success => true, :tokens => ["abc", "xyz", "123"] } end def response_hash_with_id some_response_hash.dup.update :id => "shadow_id" end def response_hash_with_inspect some_response_hash.dup.update :inspect => "shadow_inspect" end def some_soap_response build_soap_response end def soap_response_with_id build_soap_response '<id>shadow_id</id>' end def soap_response_with_inspect build_soap_response '<inspect>shadow_inspect</inspect>' end def soap_fault_response '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">' << '<soap:Body>' << '<soap:Fault>' << '<faultcode>' << soap_fault_code << '</faultcode>' << '<faultstring>' << soap_fault << '</faultstring>' << '</soap:Fault>' << '</soap:Body>' << '</soap:Envelope>' end def soap_fault "Failed to authenticate client." end def soap_fault_code "soap:Server" end private def build_soap_response(mixin = "") '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">' << '<soap:Body>' << '<ns2:result xmlns:ns2="http://example.com/">' << '<return>' << '<authentication>' << '<user>example</user>' << '<password>secret</password>' << '</authentication>' << mixin << '<success>true</success>' << '<tokens>abc</tokens>' << '<tokens>xyz</tokens>' << '<tokens>123</tokens>' << '</return>' << '</ns2:result>' << '</soap:Body>' << '</soap:Envelope>' end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
smacks-savon-0.1.2 | test/fixtures/soap_response_fixture.rb |