Sha256: 36d8bdbf5eb54d8590be185ac671e2e31a1919a507039e932bea7d23bc44deb1

Contents?: true

Size: 1.45 KB

Versions: 60

Compression:

Stored size: 1.45 KB

Contents

require 'spec_helper'

describe NetSuite::Records::WorkOrderItem do
  let(:work_order) { NetSuite::Records::WorkOrderItem.new }

  [
    :average_cost, :bom_quantity, :commit, :component_yield, :contribution,
    :create_po, :create_wo, :description, :inventory_detail,
    :last_purchase_price, :line, :order_priority, :percent_complete, :po_rate,
    :quantity, :quantity_available, :quantity_back_ordered,
    :quantity_committed, :quantity_on_hand, :serial_numbers
  ].each do |field|
    it "has the #{field} field" do
      expect(work_order).to have_field(field)
    end
  end

  [
    :department, :item, :location, :po_vender, :units
  ].each do |record_ref|
    it 'has the #{record_ref} record ref' do
      expect(work_order).to have_record_ref(record_ref)
    end
  end

  describe '#custom_field_list' do
    it 'can be set from attributes' do
      attributes = {
        :custom_field => {
          :value => 10,
          :internal_id => 'custfield_something'
        }
      }
      work_order.custom_field_list = attributes
      expect(work_order.custom_field_list).to be_kind_of(NetSuite::Records::CustomFieldList)
      expect(work_order.custom_field_list.custom_fields.length).to eql(1)
    end

    it 'can be set from a CustomFieldList object' do
      custom_field_list = NetSuite::Records::CustomFieldList.new
      work_order.custom_field_list = custom_field_list
      expect(work_order.custom_field_list).to eql(custom_field_list)
    end
  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

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