Sha256: a3296ba68adc44d5c4e4a9299708ff1d956c75ad96e271c7f90d47754dfb06ca

Contents?: true

Size: 661 Bytes

Versions: 14

Compression:

Stored size: 661 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

module Spree
  module Stock
    module LocationSorter
      RSpec.describe DefaultFirst, type: :model do
        subject { described_class.new(stock_locations) }

        let!(:first_stock_location) { create(:stock_location, default: false) }
        let!(:second_stock_location) { create(:stock_location, default: true) }
        let(:stock_locations) { Spree::StockLocation.all }
        let(:sorted_stock_locations) { stock_locations.reverse }

        it 'returns the default stock location first' do
          expect(subject.sort).to eq(sorted_stock_locations)
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
solidus_core-2.10.5 spec/models/spree/stock/location_sorter/default_first_spec.rb
solidus_core-2.10.3 spec/models/spree/stock/location_sorter/default_first_spec.rb
solidus_core-2.10.2 spec/models/spree/stock/location_sorter/default_first_spec.rb
solidus_core-2.9.6 spec/models/spree/stock/location_sorter/default_first_spec.rb
solidus_core-2.10.1 spec/models/spree/stock/location_sorter/default_first_spec.rb
solidus_core-2.9.5 spec/models/spree/stock/location_sorter/default_first_spec.rb
solidus_core-2.10.0 spec/models/spree/stock/location_sorter/default_first_spec.rb
solidus_core-2.9.4 spec/models/spree/stock/location_sorter/default_first_spec.rb
solidus_core-2.9.3 spec/models/spree/stock/location_sorter/default_first_spec.rb
solidus_core-2.9.2 spec/models/spree/stock/location_sorter/default_first_spec.rb
solidus_core-2.10.0.beta1 spec/models/spree/stock/location_sorter/default_first_spec.rb
solidus_core-2.9.1 spec/models/spree/stock/location_sorter/default_first_spec.rb
solidus_core-2.9.0 spec/models/spree/stock/location_sorter/default_first_spec.rb
solidus_core-2.9.0.rc.1 spec/models/spree/stock/location_sorter/default_first_spec.rb