Sha256: 6a36410987fe16a9f83d2cde53156005c1729e33bed6d5f644b4738a931b982e

Contents?: true

Size: 1.38 KB

Versions: 4

Compression:

Stored size: 1.38 KB

Contents

require 'spec_helper'

describe NetSuite::Actions::Get do

  describe 'Customer' do
    before do
      savon.expects(:get).with({
        'platformMsgs:baseRef' => {},
        :attributes! => {
          'platformMsgs:baseRef' => {
            :internalId => 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(1, NetSuite::Records::Customer)
    end

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

  describe 'Invoice' do
    before do
      savon.expects(:get).with({
        'platformMsgs:baseRef' => {},
        :attributes! => {
          'platformMsgs:baseRef' => {
            :internalId => 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(1, NetSuite::Records::Invoice)
    end

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

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
netsuite-0.0.11 spec/netsuite/actions/get_spec.rb
netsuite-0.0.10 spec/netsuite/actions/get_spec.rb
netsuite-0.0.9 spec/netsuite/actions/get_spec.rb
netsuite-0.0.8 spec/netsuite/actions/get_spec.rb