Sha256: 6c59077a1f32d9cc756a267930a5f03c61ef42fb513bca073ff8200a0ddadec0

Contents?: true

Size: 630 Bytes

Versions: 62

Compression:

Stored size: 630 Bytes

Contents

require 'test_helper'

module Workarea
  class PricingOverrideParamsTest < TestCase
    def test_to_h
      params = PricingOverrideParams.new(subtotal_adjustment: '3.50')
      assert_equal({ 'subtotal_adjustment' => -3.5 }, params.to_h)

      user = create_user
      params = PricingOverrideParams.new(
        {
          subtotal_adjustment: '3.50',
          shipping_adjustment: '-1'
        },
        user
      )

      assert_equal(
        {
          'subtotal_adjustment' => -3.5,
          'shipping_adjustment' => 1.0,
          'created_by_id' => user.id
        },
        params.to_h
      )
    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

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