Sha256: bc157c985dc678b60639d38c09eb6099f7c18c7cf03dee854f75448d6a167b40

Contents?: true

Size: 901 Bytes

Versions: 48

Compression:

Stored size: 901 Bytes

Contents

# frozen_string_literal: true

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

48 entries across 48 versions & 2 rubygems

Version Path
solidus_core-2.10.5 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.10.3 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.10.2 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.9.6 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.8.6 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.10.1 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.9.5 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.10.0 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.9.4 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.6.6 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.7.4 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.8.5 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.9.3 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.9.2 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.10.0.beta1 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.7.3 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.6.5 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.9.1 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.9.0 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb
solidus_core-2.9.0.rc.1 spec/lib/spree/core/testing_support/factories/stock_location_factory_spec.rb