Sha256: 8091bdca4fa2d2c847e5c531801a32d21b4985408f1da6397deb87aeb58f4d79
Contents?: true
Size: 512 Bytes
Versions: 23
Compression:
Stored size: 512 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
23 entries across 23 versions & 2 rubygems