Sha256: 6202361786d7918e1604d6a245927ce4ccf754bec5b0dcd65e158ae28cf6fa6f

Contents?: true

Size: 948 Bytes

Versions: 5

Compression:

Stored size: 948 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)
      response.should be_kind_of(NetSuite::Response)
      response.should be_success
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
netsuite-0.2.4 spec/netsuite/actions/delete_spec.rb
netsuite-0.2.3 spec/netsuite/actions/delete_spec.rb
netsuite-0.2.2 spec/netsuite/actions/delete_spec.rb
netsuite-0.2.1 spec/netsuite/actions/delete_spec.rb
netsuite-0.2.0 spec/netsuite/actions/delete_spec.rb