Sha256: 4c048db70a70ebca82edf7ddcb34434debd5c400e82608e36424bf026387d02a

Contents?: true

Size: 525 Bytes

Versions: 30

Compression:

Stored size: 525 Bytes

Contents

require 'test_helper'

class ShippingCostCalculatorTest < ActiveRecord::TestCase

  test "shipping method is nil" do
    order     = Order.new
    calculator= ShippingCostCalculator.new(order)

    assert_equal 0, calculator.shipping_cost
  end

  test "shipping method is not nil" do
    shipping_method  = build :country_shipping_method
    order     = build :order, shipping_method: shipping_method
    calculator= ShippingCostCalculator.new(order)

    assert_equal 2.99, calculator.shipping_cost.round(2).to_f
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
nimbleshop_core-0.0.23 test/unit/shipping_cost_calculator_test.rb
nimbleshop_core-0.0.21 test/unit/shipping_cost_calculator_test.rb
nimbleshop_core-0.0.20 test/unit/shipping_cost_calculator_test.rb
nimbleshop_core-0.0.19 test/unit/shipping_cost_calculator_test.rb
nimbleshop_core-0.0.17 test/unit/shipping_cost_calculator_test.rb
nimbleshop_core-0.0.16 test/unit/shipping_cost_calculator_test.rb
nimbleshop_core-0.0.15 test/unit/shipping_cost_calculator_test.rb
nimbleshop_core-0.0.14 test/unit/shipping_cost_calculator_test.rb
nimbleshop_core-0.0.14.rc2 test/unit/shipping_cost_calculator_test.rb
nimbleshop_core-0.0.14.rc1 test/unit/shipping_cost_calculator_test.rb
nimbleshop_core-0.0.13 test/unit/shipping_cost_calculator_test.rb
nimbleshop_core-0.0.12 test/unit/shipping_cost_calculator_test.rb
nimbleshop_core-0.0.11 test/unit/shipping_cost_calculator_test.rb
nimbleshop_core-0.0.10 test/unit/shipping_cost_calculator_test.rb
nimbleshop_core-0.0.9 test/unit/shipping_cost_calculator_test.rb
nimbleshop_core-0.0.8 test/unit/shipping_cost_calculator_test.rb
nimbleshop_core-0.0.7 test/unit/shipping_cost_calculator_test.rb
nimbleshop_core-0.0.5 test/unit/shipping_cost_calculator_test.rb
nimbleshop_core-0.0.4.beta1 test/unit/shipping_cost_calculator_test.rb
nimbleshop_core-0.0.4 test/unit/shipping_cost_calculator_test.rb