Sha256: 1f596b158076bd05378e2216bb62e0196574f1685f07c86f5c63d007c2804b16

Contents?: true

Size: 960 Bytes

Versions: 56

Compression:

Stored size: 960 Bytes

Contents

require 'spec_helper'

describe NetSuite::Actions::Delete do
  before(:all) { savon.mock! }
  after(:all) { savon.unmock! }

  context 'Customer' do
    let(:customer) do
      NetSuite::Records::Customer.new(:internal_id => '980', :entity_id => 'Shutter Fly', :company_name => 'Shutter Fly, Inc.')
    end

    before do
      savon.expects(:delete).with(:message => {
        'platformMsgs:baseRef' => {
          '@internalId' => '980',
          '@type'       => 'customer',
          '@xsi:type'   => 'platformCore:RecordRef'
        },
      }).returns(File.read('spec/support/fixtures/delete/delete_customer.xml'))
    end

    it 'makes a valid request to the NetSuite API' do
      NetSuite::Actions::Delete.call([customer])
    end

    it 'returns a valid Response object' do
      response = NetSuite::Actions::Delete.call([customer])
      expect(response).to be_kind_of(NetSuite::Response)
      expect(response).to be_success
    end
  end

end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
netsuite-0.8.12 spec/netsuite/actions/delete_spec.rb
netsuite-0.8.11 spec/netsuite/actions/delete_spec.rb
netsuite-0.8.10 spec/netsuite/actions/delete_spec.rb
netsuite-0.8.9 spec/netsuite/actions/delete_spec.rb
netsuite-0.8.8 spec/netsuite/actions/delete_spec.rb
netsuite-0.8.7 spec/netsuite/actions/delete_spec.rb
netsuite-0.8.6 spec/netsuite/actions/delete_spec.rb
netsuite-0.8.5 spec/netsuite/actions/delete_spec.rb
netsuite-0.8.4 spec/netsuite/actions/delete_spec.rb
netsuite-0.8.3 spec/netsuite/actions/delete_spec.rb
netsuite-0.8.2 spec/netsuite/actions/delete_spec.rb
netsuite-0.8.1 spec/netsuite/actions/delete_spec.rb
netsuite-0.8.0 spec/netsuite/actions/delete_spec.rb
netsuite-0.7.9 spec/netsuite/actions/delete_spec.rb
netsuite-0.7.8 spec/netsuite/actions/delete_spec.rb
netsuite-0.7.7 spec/netsuite/actions/delete_spec.rb
netsuite-0.7.6 spec/netsuite/actions/delete_spec.rb
netsuite-0.7.5 spec/netsuite/actions/delete_spec.rb
netsuite-0.7.4 spec/netsuite/actions/delete_spec.rb
netsuite-0.7.3 spec/netsuite/actions/delete_spec.rb