Sha256: 893812ed615a23cbd156e85db3a2fd22dec7dec08ae7d30270c10344de2b117b
Contents?: true
Size: 860 Bytes
Versions: 22
Compression:
Stored size: 860 Bytes
Contents
require 'spec_helper' module Spree module Calculator::Shipping describe PriceSack do let(:variant) { build(:variant, price: 2) } subject(:calculator) do calculator = PriceSack.new calculator.preferred_minimal_amount = 5 calculator.preferred_normal_amount = 10 calculator.preferred_discount_amount = 1 calculator end let(:normal_package) do build(:stock_package, variants_contents: { variant => 2 }) end let(:discount_package) do build(:stock_package, variants_contents: { variant => 4 }) end it 'computes the correct amount' do expect(calculator.compute(normal_package)).to eq(calculator.preferred_normal_amount) expect(calculator.compute(discount_package)).to eq(calculator.preferred_discount_amount) end end end end
Version data entries
22 entries across 22 versions & 1 rubygems