Sha256: 120b6bacaf307f2c594f84ac055e58dd235d4e89e540e8376601c4adffba6bd5

Contents?: true

Size: 1.09 KB

Versions: 13

Compression:

Stored size: 1.09 KB

Contents

# frozen_string_literal: true

require 'rails_helper'

RSpec.describe Spree::Core::StockConfiguration do
  describe '#coordinator_class' do
    let(:stock_configuration) { described_class.new }
    subject { stock_configuration.coordinator_class }

    it "returns Spree::Stock::Coordinator" do
      is_expected.to be ::Spree::Stock::SimpleCoordinator
    end

    context "with another constant name assiged" do
      MyCoordinator = Class.new
      before { stock_configuration.coordinator_class = MyCoordinator.to_s }

      it "returns the constant" do
        is_expected.to be MyCoordinator
      end
    end
  end
  describe '#estimator_class' do
    let(:stock_configuration) { described_class.new }
    subject { stock_configuration.estimator_class }

    it "returns Spree::Stock::Estimator" do
      is_expected.to be ::Spree::Stock::Estimator
    end

    context "with another constant name assiged" do
      MyEstimator = Class.new
      before { stock_configuration.estimator_class = MyEstimator.to_s }

      it "returns the constant" do
        is_expected.to be MyEstimator
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
solidus_core-2.6.6 spec/lib/spree/core/stock_configuration_spec.rb
solidus_core-2.7.4 spec/lib/spree/core/stock_configuration_spec.rb
solidus_core-2.7.3 spec/lib/spree/core/stock_configuration_spec.rb
solidus_core-2.6.5 spec/lib/spree/core/stock_configuration_spec.rb
solidus_core-2.7.2 spec/lib/spree/core/stock_configuration_spec.rb
solidus_core-2.6.4 spec/lib/spree/core/stock_configuration_spec.rb
solidus_core-2.6.3 spec/lib/spree/core/stock_configuration_spec.rb
solidus_core-2.7.1 spec/lib/spree/core/stock_configuration_spec.rb
solidus_core-2.6.2 spec/lib/spree/core/stock_configuration_spec.rb
solidus_core-2.7.0 spec/lib/spree/core/stock_configuration_spec.rb
solidus_core-2.6.1 spec/lib/spree/core/stock_configuration_spec.rb
solidus_core-2.6.0 spec/lib/spree/core/stock_configuration_spec.rb
solidus_core-2.6.0.rc1 spec/lib/spree/core/stock_configuration_spec.rb