Sha256: e9e855e83de27f58ffeeba50b57615593094ce7b32362d6805b19e2c0e629b37

Contents?: true

Size: 1.04 KB

Versions: 33

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'

describe NetSuite::Records::AssemblyItem do
  let(:item) { described_class.new }

  describe '#member_list' do
    it 'can be set from attributes' do
      attributes = {
        :item_member => [{
          :item => { :internal_id => 1 },
          :quantity => 20
        }]
      }
      item.member_list = attributes
      expect(item.member_list).to be_kind_of(NetSuite::Records::MemberList)
      expect(item.member_list.item_member.length).to eql(1)

      expect(item.member_list.item_member.first.item.internal_id).to eq(1)
      expect(item.member_list.item_member.first.quantity).to eq(20)
    end
  end

  describe '#subsidiary_list' do
    it 'creates record refs from attributes' do
      item = described_class.new({
        subsidiary_list: {
          record_ref: [
            { internal_id: 1 },
            { internal_id: 2 },
          ]
        }
      })

      expect(item.subsidiary_list.record_ref[0].internal_id).to eq(1)
      expect(item.subsidiary_list.record_ref[1].internal_id).to eq(2)
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
netsuite-0.6.9 spec/netsuite/records/assembly_item_spec.rb
netsuite-0.6.8 spec/netsuite/records/assembly_item_spec.rb
netsuite-0.6.7 spec/netsuite/records/assembly_item_spec.rb
netsuite-0.6.6 spec/netsuite/records/assembly_item_spec.rb
netsuite-0.6.5 spec/netsuite/records/assembly_item_spec.rb
netsuite-0.6.4 spec/netsuite/records/assembly_item_spec.rb
netsuite-0.6.3 spec/netsuite/records/assembly_item_spec.rb
netsuite-0.6.2 spec/netsuite/records/assembly_item_spec.rb
netsuite-0.6.1 spec/netsuite/records/assembly_item_spec.rb
netsuite-0.6.0 spec/netsuite/records/assembly_item_spec.rb
netsuite-0.5.9 spec/netsuite/records/assembly_item_spec.rb
netsuite-0.5.8 spec/netsuite/records/assembly_item_spec.rb
netsuite-0.5.7 spec/netsuite/records/assembly_item_spec.rb
netsuite-0.5.6 spec/netsuite/records/assembly_item_spec.rb
netsuite-0.5.5 spec/netsuite/records/assembly_item_spec.rb
netsuite-0.5.4 spec/netsuite/records/assembly_item_spec.rb
netsuite-0.5.3 spec/netsuite/records/assembly_item_spec.rb
netsuite-0.5.2 spec/netsuite/records/assembly_item_spec.rb
netsuite-0.5.1 spec/netsuite/records/assembly_item_spec.rb
netsuite-0.5.0 spec/netsuite/records/assembly_item_spec.rb