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.26 spec/netsuite/actions/get_spec.rb
netsuite-0.0.25 spec/netsuite/actions/get_spec.rb
netsuite-0.0.23 spec/netsuite/actions/get_spec.rb
netsuite-0.0.22 spec/netsuite/actions/get_spec.rb
netsuite-0.0.21 spec/netsuite/actions/get_spec.rb
netsuite-0.0.20 spec/netsuite/actions/get_spec.rb
netsuite-0.0.19 spec/netsuite/actions/get_spec.rb
netsuite-0.0.18 spec/netsuite/actions/get_spec.rb
netsuite-0.0.17 spec/netsuite/actions/get_spec.rb
netsuite-0.0.16 spec/netsuite/actions/get_spec.rb