Sha256: ac904399911dd00a3f5c55475c7fdf0f420f084b29a34b5f84334da164da3c2a

Contents?: true

Size: 1.44 KB

Versions: 30

Compression:

Stored size: 1.44 KB

Contents

require 'spec_helper'

describe NetSuite::Actions::Get do

  describe 'Customer' do
    before do
      savon.expects(:get).with({
        'platformMsgs:baseRef' => {},
        :attributes! => {
          'platformMsgs:baseRef' => {
            :externalId => 1,
            :type       => 'customer',
            'xsi:type'  => 'platformCore:RecordRef'
          }
        }
      }).returns(:get_customer)
    end

    it 'makes a valid request to the NetSuite API' do
      NetSuite::Actions::Get.call(NetSuite::Records::Customer, :external_id => 1)
    end

    it 'returns a valid Response object' do
      response = NetSuite::Actions::Get.call(NetSuite::Records::Customer, :external_id => 1)
      response.should be_kind_of(NetSuite::Response)
    end
  end

  describe 'Invoice' do
    before do
      savon.expects(:get).with({
        'platformMsgs:baseRef' => {},
        :attributes! => {
          'platformMsgs:baseRef' => {
            :externalId => 10,
            :type       => 'invoice',
            'xsi:type'  => 'platformCore:RecordRef'
          }
        }
      }).returns(:get_invoice)
    end

    it 'makes a valid request to the NetSuite API' do
      NetSuite::Actions::Get.call(NetSuite::Records::Invoice, :external_id => 1)
    end

    it 'returns a valid Response object' do
      response = NetSuite::Actions::Get.call(NetSuite::Records::Invoice, :external_id => 1)
      response.should be_kind_of(NetSuite::Response)
    end
  end

end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
netsuite-0.0.47 spec/netsuite/actions/get_spec.rb
netsuite-0.0.45 spec/netsuite/actions/get_spec.rb
netsuite-0.0.44 spec/netsuite/actions/get_spec.rb
netsuite-0.0.43 spec/netsuite/actions/get_spec.rb
netsuite-0.0.42 spec/netsuite/actions/get_spec.rb
netsuite-0.0.41 spec/netsuite/actions/get_spec.rb
netsuite-0.0.40 spec/netsuite/actions/get_spec.rb
netsuite-0.0.39 spec/netsuite/actions/get_spec.rb
netsuite-0.0.38 spec/netsuite/actions/get_spec.rb
netsuite-0.0.37 spec/netsuite/actions/get_spec.rb
netsuite-0.0.36 spec/netsuite/actions/get_spec.rb
netsuite-0.0.35 spec/netsuite/actions/get_spec.rb
netsuite-0.0.34 spec/netsuite/actions/get_spec.rb
netsuite-0.0.33 spec/netsuite/actions/get_spec.rb
netsuite-0.0.32 spec/netsuite/actions/get_spec.rb
netsuite-0.0.31 spec/netsuite/actions/get_spec.rb
netsuite-0.0.30 spec/netsuite/actions/get_spec.rb
netsuite-0.0.29 spec/netsuite/actions/get_spec.rb
netsuite-0.0.28 spec/netsuite/actions/get_spec.rb
netsuite-0.0.27 spec/netsuite/actions/get_spec.rb