Sha256: 77ce8f84927cf577607adf6958c0f81910615df80123404b2b2ae2e5843808b4

Contents?: true

Size: 504 Bytes

Versions: 15

Compression:

Stored size: 504 Bytes

Contents

require 'spec_helper'
require 'shared_examples/calculator_shared_examples'

module Spree
  class Calculator
    describe PercentOnLineItem, type: :model do
      context "compute" 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

      it_behaves_like 'a calculator with a description'
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
solidus_core-2.3.1 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.2.2 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.1.1 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.3.0 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.3.0.rc3 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.3.0.rc2 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.3.0.rc1 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.3.0.beta1 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.2.1 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.2.0 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.2.0.rc1 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.2.0.beta1 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.1.0 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.1.0.rc1 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.1.0.beta1 spec/models/spree/calculator/percent_on_line_item_spec.rb