Sha256: c4732ed3453610387583bfc64ad1a7aef910e01d3a8c3a72b15e38bc10cc8e01

Contents?: true

Size: 347 Bytes

Versions: 23

Compression:

Stored size: 347 Bytes

Contents

require 'spec_helper'

module Spree
  class Calculator
    describe PercentOnLineItem, type: :model do
      let(:line_item) { double("LineItem", amount: 100) }

      before { subject.preferred_percent = 15 }

      it "computes based on item price and quantity" do
        expect(subject.compute(line_item)).to eq 15
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
solidus_core-2.0.3 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-1.4.2 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-1.3.2 spec/models/spree/calculator/percent_on_line_item_spec.rb
spree_core-3.3.0.rc1 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.0.2 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-1.4.1 spec/models/spree/calculator/percent_on_line_item_spec.rb
spree_core-3.2.1 spec/models/spree/calculator/percent_on_line_item_spec.rb
spree_core-3.2.0 spec/models/spree/calculator/percent_on_line_item_spec.rb
spree_core-3.2.0.rc3 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.0.1 spec/models/spree/calculator/percent_on_line_item_spec.rb
spree_core-3.2.0.rc2 spec/models/spree/calculator/percent_on_line_item_spec.rb
spree_core-3.2.0.rc1 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.0.0 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-1.4.0 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.0.0.rc1 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-1.4.0.rc1 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.0.0.beta1 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-1.4.0.beta1 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-1.3.1 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-1.3.0 spec/models/spree/calculator/percent_on_line_item_spec.rb