Sha256: fc0871fa017d5a624527963b275a253a10e540b3b36778c95b3b999692be8086

Contents?: true

Size: 870 Bytes

Versions: 11

Compression:

Stored size: 870 Bytes

Contents

require 'rails_helper'
require 'spree/testing_support/factories/stock_location_factory'

RSpec.describe 'stock location factory' do
  let(:factory_class) { Spree::StockLocation }

  describe 'plain stock location' do
    let(:factory) { :stock_location }

    it_behaves_like 'a working factory'
  end

  describe 'stock location without variant propagation' do
    let(:factory) { :stock_location_without_variant_propagation }

    it_behaves_like 'a working factory'
  end

  describe 'stock location with items' do
    let(:factory) { :stock_location_with_items }

    it_behaves_like 'a working factory'
  end

  describe 'stock location for a country without subregions' do
    let(:country) { create(:country, iso: 'HK') }
    it 'succeeds' do
      expect(
        create(:stock_location, country: country)
      ).to be_a(Spree::StockLocation)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
solidus_core-2.5.2 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.5.1 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.5.0 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.5.0.rc1 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.5.0.beta2 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.5.0.beta1 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.4.2 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.4.1 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.4.0 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.4.0.rc1 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.4.0.beta1 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb