Sha256: b6d2d9bfb198a9e4760b738437886444ce3448683ae05b3ccfff8c539c3de2e9

Contents?: true

Size: 665 Bytes

Versions: 53

Compression:

Stored size: 665 Bytes

Contents

require 'spec_helper'
require 'ostruct'

module NetSuite
  module Records
    describe MatrixOptionList do
      it "deals with hash properly" do
        hash = {:value=>{:@internal_id=>"1", :@type_id=>"36"}}

        list = described_class.new({ matrix_option: hash })
        expect(list.options.first.value_id).to eq "1"
      end

      it "deals with arrays properly" do
        array = [
          {:value=>{:@internal_id=>"2", :@type_id=>"28"}},
          {:value=>{:@internal_id=>"1", :@type_id=>"29"}}
        ]

        list = described_class.new({ matrix_option: array })
        expect(list.options.first.value_id).to eq "2"
      end
    end
  end
end

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
netsuite-0.4.4 spec/netsuite/records/matrix_option_list_spec.rb
netsuite-0.4.3 spec/netsuite/records/matrix_option_list_spec.rb
netsuite-0.4.2 spec/netsuite/records/matrix_option_list_spec.rb
netsuite-0.4.1 spec/netsuite/records/matrix_option_list_spec.rb
netsuite-0.4.0 spec/netsuite/records/matrix_option_list_spec.rb
netsuite-0.3.3 spec/netsuite/records/matrix_option_list_spec.rb
netsuite-0.3.2 spec/netsuite/records/matrix_option_list_spec.rb
netsuite-0.3.1 spec/netsuite/records/matrix_option_list_spec.rb
netsuite-0.3.0 spec/netsuite/records/matrix_option_list_spec.rb
netsuite-0.2.6 spec/netsuite/records/matrix_option_list_spec.rb
netsuite-0.2.5 spec/netsuite/records/matrix_option_list_spec.rb
netsuite-0.2.4 spec/netsuite/records/matrix_option_list_spec.rb
netsuite-0.2.3 spec/netsuite/records/matrix_option_list_spec.rb