Sha256: f31168e2c7ef31bb3ae461da0deb2009a5fdad9c21a715f5f40660db6c020165

Contents?: true

Size: 832 Bytes

Versions: 62

Compression:

Stored size: 832 Bytes

Contents

require 'test_helper'

module Workarea
  module Pricing
    module Calculators
      class CustomizationsCalculatorTest < TestCase
        def test_adjust
          create_pricing_sku(id: 'SKU', prices: [{ regular: 5.to_m }])
          create_pricing_sku(id: 'CUST', prices: [{ regular: 1.to_m }])

          order = Order.new
          order.add_item(
            product_id: 'PRODUCT',
            sku: 'SKU',
            quantity: 2,
            customizations: { 'pricing_sku' => 'CUST' }
          )

          CustomizationsCalculator.test_adjust(order)

          assert_equal(1, order.items.first.price_adjustments.length)
          assert_equal('item', order.items.first.price_adjustments.first.price)
          assert_equal(2.to_m, order.items.first.price_adjustments.first.amount)
        end
      end
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
workarea-core-3.5.27 test/models/workarea/pricing/calculators/customizations_calculator_test.rb
workarea-core-3.5.26 test/models/workarea/pricing/calculators/customizations_calculator_test.rb
workarea-core-3.4.45 test/models/workarea/pricing/calculators/customizations_calculator_test.rb
workarea-core-3.5.25 test/models/workarea/pricing/calculators/customizations_calculator_test.rb
workarea-core-3.5.23 test/models/workarea/pricing/calculators/customizations_calculator_test.rb
workarea-core-3.4.44 test/models/workarea/pricing/calculators/customizations_calculator_test.rb
workarea-core-3.5.22 test/models/workarea/pricing/calculators/customizations_calculator_test.rb
workarea-core-3.4.43 test/models/workarea/pricing/calculators/customizations_calculator_test.rb
workarea-core-3.5.21 test/models/workarea/pricing/calculators/customizations_calculator_test.rb
workarea-core-3.4.42 test/models/workarea/pricing/calculators/customizations_calculator_test.rb
workarea-core-3.5.20 test/models/workarea/pricing/calculators/customizations_calculator_test.rb
workarea-core-3.4.41 test/models/workarea/pricing/calculators/customizations_calculator_test.rb
workarea-core-3.5.19 test/models/workarea/pricing/calculators/customizations_calculator_test.rb
workarea-core-3.4.40 test/models/workarea/pricing/calculators/customizations_calculator_test.rb
workarea-core-3.5.18 test/models/workarea/pricing/calculators/customizations_calculator_test.rb
workarea-core-3.4.39 test/models/workarea/pricing/calculators/customizations_calculator_test.rb
workarea-core-3.5.17 test/models/workarea/pricing/calculators/customizations_calculator_test.rb
workarea-core-3.4.38 test/models/workarea/pricing/calculators/customizations_calculator_test.rb
workarea-core-3.5.16 test/models/workarea/pricing/calculators/customizations_calculator_test.rb
workarea-core-3.4.37 test/models/workarea/pricing/calculators/customizations_calculator_test.rb