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.7.2 spec/netsuite/actions/delete_spec.rb
netsuite-0.7.1 spec/netsuite/actions/delete_spec.rb
netsuite-0.7.0 spec/netsuite/actions/delete_spec.rb
netsuite-0.6.9 spec/netsuite/actions/delete_spec.rb
netsuite-0.6.8 spec/netsuite/actions/delete_spec.rb
netsuite-0.6.7 spec/netsuite/actions/delete_spec.rb
netsuite-0.6.6 spec/netsuite/actions/delete_spec.rb
netsuite-0.6.5 spec/netsuite/actions/delete_spec.rb
netsuite-0.6.4 spec/netsuite/actions/delete_spec.rb
netsuite-0.6.3 spec/netsuite/actions/delete_spec.rb
netsuite-0.6.2 spec/netsuite/actions/delete_spec.rb
netsuite-0.6.1 spec/netsuite/actions/delete_spec.rb
netsuite-0.6.0 spec/netsuite/actions/delete_spec.rb
netsuite-0.5.9 spec/netsuite/actions/delete_spec.rb
netsuite-0.5.8 spec/netsuite/actions/delete_spec.rb
netsuite-0.5.7 spec/netsuite/actions/delete_spec.rb
netsuite-0.5.6 spec/netsuite/actions/delete_spec.rb
netsuite-0.5.5 spec/netsuite/actions/delete_spec.rb
netsuite-0.5.4 spec/netsuite/actions/delete_spec.rb
netsuite-0.5.3 spec/netsuite/actions/delete_spec.rb