Sha256: f1506aa7c78cb4782938dabd587e0fce2a4e31b758a0a030dc1a58b6bac82c13
Contents?: true
Size: 685 Bytes
Versions: 32
Compression:
Stored size: 685 Bytes
Contents
require 'spec_helper' module Spree module Calculator::Shipping describe FlatPercentItemTotal, :type => :model do let(:variant1) { build(:variant, :price => 10.11) } let(:variant2) { build(:variant, :price => 20.2222) } let(:line_item1) { build(:line_item, variant: variant1) } let(:line_item2) { build(:line_item, variant: variant2) } let(:package) do build(:stock_package, variants_contents: { variant1 => 2, variant2 => 1 }) end subject { FlatPercentItemTotal.new(:preferred_flat_percent => 10) } it "should round result correctly" do expect(subject.compute(package)).to eq(4.04) end end end end
Version data entries
32 entries across 32 versions & 2 rubygems