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.7.6 spec/netsuite/actions/initialize_spec.rb
netsuite-0.7.5 spec/netsuite/actions/initialize_spec.rb
netsuite-0.7.4 spec/netsuite/actions/initialize_spec.rb
netsuite-0.7.3 spec/netsuite/actions/initialize_spec.rb
netsuite-0.7.2 spec/netsuite/actions/initialize_spec.rb
netsuite-0.7.1 spec/netsuite/actions/initialize_spec.rb
netsuite-0.7.0 spec/netsuite/actions/initialize_spec.rb
netsuite-0.6.9 spec/netsuite/actions/initialize_spec.rb
netsuite-0.6.8 spec/netsuite/actions/initialize_spec.rb
netsuite-0.6.7 spec/netsuite/actions/initialize_spec.rb
netsuite-0.6.6 spec/netsuite/actions/initialize_spec.rb
netsuite-0.6.5 spec/netsuite/actions/initialize_spec.rb
netsuite-0.6.4 spec/netsuite/actions/initialize_spec.rb
netsuite-0.6.3 spec/netsuite/actions/initialize_spec.rb
netsuite-0.6.2 spec/netsuite/actions/initialize_spec.rb
netsuite-0.6.1 spec/netsuite/actions/initialize_spec.rb
netsuite-0.6.0 spec/netsuite/actions/initialize_spec.rb
netsuite-0.5.9 spec/netsuite/actions/initialize_spec.rb
netsuite-0.5.8 spec/netsuite/actions/initialize_spec.rb
netsuite-0.5.7 spec/netsuite/actions/initialize_spec.rb