Sha256: d55a21689853a5e71c9cbd7da90f80c872d5b0993a728df54b2d6cb7c8f57a2d
Contents?: true
Size: 518 Bytes
Versions: 32
Compression:
Stored size: 518 Bytes
Contents
require 'spec_helper' module Spree module Calculator::Shipping describe PerItem, :type => :model do let(:variant1) { build(:variant) } let(:variant2) { build(:variant) } let(:package) do build(:stock_package, variants_contents: { variant1 => 5, variant2 => 3 }) end subject { PerItem.new(:preferred_amount => 10) } it "correctly calculates per item shipping" do expect(subject.compute(package).to_f).to eq(80) # 5 x 10 + 3 x 10 end end end end
Version data entries
32 entries across 32 versions & 2 rubygems