Sha256: 057765acc77c4b2e83713547ca9ce0c9b9838d3fed55865ff13190ebab88d83a

Contents?: true

Size: 1.36 KB

Versions: 54

Compression:

Stored size: 1.36 KB

Contents

require 'spec_helper'

describe NetSuite::Records::InventoryAssignmentList do
  let(:list) { NetSuite::Records::InventoryAssignmentList.new }

  it 'has an assignments attribute' do
    expect(list.inventory_assignment).to be_kind_of(Array)
  end

  describe '#to_record' do
    before do
      list.inventory_assignment << NetSuite::Records::InventoryAssignment.new(
        :quantity => 1
      )
    end

    it 'can represent itself as a SOAP record' do

      record = {
        'platformCommon:inventoryAssignment' => [{
          'platformCommon:quantity' => 1
        }]
      }
      expect(list.to_record).to eql(record)
    end

    it 'can represent replacing all' do
      list.replace_all = true

      record = {
        'platformCommon:inventoryAssignment' => [{
          'platformCommon:quantity' => 1
        }],
        :@replaceAll => true,
      }

      expect(list.to_record).to eql(record)
    end

    it 'accepts a false replacing all' do
      list = NetSuite::Records::InventoryAssignmentList.new(
        :inventory_assignment => {
          :quantity => 1
        },
        :replace_all => true,
      )
      list.replace_all = false

      record = {
        'platformCommon:inventoryAssignment' => [{
          'platformCommon:quantity' => 1
        }],
        :@replaceAll => false,
      }

      expect(list.to_record).to eql(record)
    end
  end
end

Version data entries

54 entries across 54 versions & 1 rubygems

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