Sha256: 70bcd676551e77e12c4a4a7039c13fa2e4dc40068cf1a7a4b914e13e18639ec0
Contents?: true
Size: 1.38 KB
Versions: 4
Compression:
Stored size: 1.38 KB
Contents
require "spec_helper" module ShipCompliant describe AddUpdateBrand do before { savon.mock! } after { savon.unmock! } let(:message) do { 'Request' => { 'Security' => { 'PartnerKey' => 'abc-123', 'Username' => 'bob@example.com', 'Password' => 'secret' }, 'Brand' => { 'Key' => 'WNDFL', 'Name' => 'Wonderful', 'Owner' => { 'Name' => 'Sam' } }, 'UpdateMode' => 'DoWackaDo' } } end let(:response) { File.read('spec/fixtures/add_update_product.xml') } context "brand" do it "queries the client with an update mode" do savon.expects(:add_update_brand) .with(message: message).returns(response) result = AddUpdateBrand.brand({ key: 'WNDFL', name: 'Wonderful', owner: { name: 'Sam' } }, update_mode: 'DoWackaDo') result.should be_kind_of(AddUpdateBrandResult) end it "update mode defaults to ErrorOnExisting" do message['Request']['UpdateMode'] = 'ErrorOnExisting' savon.expects(:add_update_brand) .with(message: message).returns(response) AddUpdateBrand.brand({ key: 'WNDFL', name: 'Wonderful', owner: { name: 'Sam' } }) end end end end
Version data entries
4 entries across 4 versions & 1 rubygems