Sha256: 404cec51e52da565bc562d4dfb11161baa2eb43c22e4de9ef73b8f6af5e659dd

Contents?: true

Size: 896 Bytes

Versions: 15

Compression:

Stored size: 896 Bytes

Contents

require 'spec_helper'

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

  before do
    savon.expects(:initialize).with({
      'platformMsgs:initializeRecord' => {
        'platformCore:type' => 'invoice',
        'platformCore:reference' => {
          'platformCore:name' => 'Ryan Moran'
        },
        :attributes! => {
          'platformCore:reference' => {
            'internalId' => '1',
            :type        => 'customer'
          }
        }
      }
    }).returns(:initialize_invoice_from_customer)
  end

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

  it 'returns a valid Response object' do
    response = NetSuite::Actions::Initialize.call(customer)
    response.should be_kind_of(NetSuite::Response)
    response.should be_success
  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
netsuite-0.0.19 spec/netsuite/actions/initialize_spec.rb
netsuite-0.0.18 spec/netsuite/actions/initialize_spec.rb
netsuite-0.0.17 spec/netsuite/actions/initialize_spec.rb
netsuite-0.0.16 spec/netsuite/actions/initialize_spec.rb
netsuite-0.0.15 spec/netsuite/actions/initialize_spec.rb
netsuite-0.0.14 spec/netsuite/actions/initialize_spec.rb
netsuite-0.0.13 spec/netsuite/actions/initialize_spec.rb
netsuite-0.0.12 spec/netsuite/actions/initialize_spec.rb
netsuite-0.0.11 spec/netsuite/actions/initialize_spec.rb
netsuite-0.0.10 spec/netsuite/actions/initialize_spec.rb
netsuite-0.0.9 spec/netsuite/actions/initialize_spec.rb
netsuite-0.0.8 spec/netsuite/actions/initialize_spec.rb
netsuite-0.0.7 spec/netsuite/actions/initialize_spec.rb
netsuite-0.0.6 spec/netsuite/actions/initialize_spec.rb
netsuite-0.0.5 spec/netsuite/actions/initialize_spec.rb