Sha256: 131bef6b3adb4da3839615af21d9428ae90c52af1b67babd46a6eeac01af7590

Contents?: true

Size: 1.01 KB

Versions: 60

Compression:

Stored size: 1.01 KB

Contents

require 'spec_helper'

describe NetSuite::Actions::Initialize do
  before(:all) { savon.mock! }
  after(:all) { savon.unmock! }

  let(:customer) { NetSuite::Records::Customer.new(:internal_id => 1) }

  before do
    savon.expects(:initialize).with(:message => {
      'platformMsgs:initializeRecord' => {
        'platformCore:type' => 'customer',
        'platformCore:reference' => {},
        :attributes! => {
          'platformCore:reference' => {
            'internalId' => 1,
            :type        => 'customer'
          }
        }
      }
    }).returns(File.read('spec/support/fixtures/initialize/initialize_invoice_from_customer.xml'))
  end

  it 'makes a valid request to the NetSuite API' do
    NetSuite::Actions::Initialize.call([NetSuite::Records::Customer, customer])
  end

  it 'returns a valid Response object' do
    response = NetSuite::Actions::Initialize.call([NetSuite::Records::Customer, customer])
    expect(response).to be_kind_of(NetSuite::Response)
    expect(response).to be_success
  end

end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
netsuite-0.9.3 spec/netsuite/actions/initialize_spec.rb
netsuite-0.9.2 spec/netsuite/actions/initialize_spec.rb
netsuite-0.9.1 spec/netsuite/actions/initialize_spec.rb
netsuite-0.9.0 spec/netsuite/actions/initialize_spec.rb
netsuite-0.8.12 spec/netsuite/actions/initialize_spec.rb
netsuite-0.8.11 spec/netsuite/actions/initialize_spec.rb
netsuite-0.8.10 spec/netsuite/actions/initialize_spec.rb
netsuite-0.8.9 spec/netsuite/actions/initialize_spec.rb
netsuite-0.8.8 spec/netsuite/actions/initialize_spec.rb
netsuite-0.8.7 spec/netsuite/actions/initialize_spec.rb
netsuite-0.8.6 spec/netsuite/actions/initialize_spec.rb
netsuite-0.8.5 spec/netsuite/actions/initialize_spec.rb
netsuite-0.8.4 spec/netsuite/actions/initialize_spec.rb
netsuite-0.8.3 spec/netsuite/actions/initialize_spec.rb
netsuite-0.8.2 spec/netsuite/actions/initialize_spec.rb
netsuite-0.8.1 spec/netsuite/actions/initialize_spec.rb
netsuite-0.8.0 spec/netsuite/actions/initialize_spec.rb
netsuite-0.7.9 spec/netsuite/actions/initialize_spec.rb
netsuite-0.7.8 spec/netsuite/actions/initialize_spec.rb
netsuite-0.7.7 spec/netsuite/actions/initialize_spec.rb