Sha256: 91247cbcc6f1c9715e134bd7a17f0d296241ffbea1f2787259b07b618366f6ce

Contents?: true

Size: 811 Bytes

Versions: 16

Compression:

Stored size: 811 Bytes

Contents

require 'spec_helper'

describe NetSuite::Records::PricingMatrix do
  describe "#initialize" do
    it "behaves appropriately if it gets a hash as attributes[:pricing]" do
      # this is what savon returns if there is only one pricing strategy matrix
      # for the item:
      matrix = {
        :pricing=> {
          :currency=>"US Dollar",
          :priceLevel=>"Base Price",
          :priceList=>[
            {:price=>{:value=>12.0, :quantity=>0.0}},
            {:price=>{:value=>10.0, :quantity=>10.0}},
            {:price=>{:value=>9.0, :quantity=>100.0}},
            {:price=>{:value=>7.0, :quantity=>5000.0}}
          ]
        }
      }

      subject = NetSuite::Records::PricingMatrix.new({pricing: matrix})
      expect(subject.prices[0].pricing).to eq(matrix[:pricing])
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
netsuite-0.8.3 spec/netsuite/records/pricing_matrix_spec.rb
netsuite-0.8.2 spec/netsuite/records/pricing_matrix_spec.rb
netsuite-0.8.1 spec/netsuite/records/pricing_matrix_spec.rb
netsuite-0.8.0 spec/netsuite/records/pricing_matrix_spec.rb
netsuite-0.7.9 spec/netsuite/records/pricing_matrix_spec.rb
netsuite-0.7.8 spec/netsuite/records/pricing_matrix_spec.rb
netsuite-0.7.7 spec/netsuite/records/pricing_matrix_spec.rb
netsuite-0.7.6 spec/netsuite/records/pricing_matrix_spec.rb
netsuite-0.7.5 spec/netsuite/records/pricing_matrix_spec.rb
netsuite-0.7.4 spec/netsuite/records/pricing_matrix_spec.rb
netsuite-0.7.3 spec/netsuite/records/pricing_matrix_spec.rb
netsuite-0.7.2 spec/netsuite/records/pricing_matrix_spec.rb
netsuite-0.7.1 spec/netsuite/records/pricing_matrix_spec.rb
netsuite-0.7.0 spec/netsuite/records/pricing_matrix_spec.rb
netsuite-0.6.9 spec/netsuite/records/pricing_matrix_spec.rb
netsuite-0.6.8 spec/netsuite/records/pricing_matrix_spec.rb