Sha256: d02f96f13da5ec39724fb0917afacf0d4f4e3d1b36c7a76f1bf14032c4444f1c

Contents?: true

Size: 509 Bytes

Versions: 48

Compression:

Stored size: 509 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'
require 'shared_examples/calculator_shared_examples'

module Spree
  RSpec.describe Calculator::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

Version data entries

48 entries across 48 versions & 2 rubygems

Version Path
solidus_core-2.10.5 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.10.3 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.10.2 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.9.6 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.8.6 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.10.1 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.9.5 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.10.0 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.9.4 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.6.6 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.7.4 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.8.5 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.9.3 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.9.2 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.10.0.beta1 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.7.3 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.6.5 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.9.1 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.9.0 spec/models/spree/calculator/percent_on_line_item_spec.rb
solidus_core-2.9.0.rc.1 spec/models/spree/calculator/percent_on_line_item_spec.rb