Sha256: 328b99582a80f7cce13536a490e8c54a16c53c8a572e2c73f21f5c5231fbeca2

Contents?: true

Size: 908 Bytes

Versions: 23

Compression:

Stored size: 908 Bytes

Contents

require 'spec_helper'

describe NetSuite::Actions::Delete do

  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({
        'platformMsgs:baseRef' => {},
        :attributes! => {
          'platformMsgs:baseRef' => {
            'internalId' => '980',
            'type'       => 'customer',
            'xsi:type'   => 'platformCore:RecordRef'
          }
        }
      }).returns(:delete_customer)
    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

23 entries across 23 versions & 1 rubygems

Version Path
netsuite-0.0.29 spec/netsuite/actions/delete_spec.rb
netsuite-0.0.28 spec/netsuite/actions/delete_spec.rb
netsuite-0.0.27 spec/netsuite/actions/delete_spec.rb