Sha256: a182a3ac9268287a9c78c0ce80c4644a4c55aaa942f0ac2fecde21ec7372eace
Contents?: true
Size: 916 Bytes
Versions: 48
Compression:
Stored size: 916 Bytes
Contents
# frozen_string_literal: true require 'rails_helper' module Spree module Stock module Splitter RSpec.describe Backordered, type: :model do let(:variant) { build(:variant) } let(:stock_location) { mock_model(Spree::StockLocation) } subject { Backordered.new(stock_location) } it 'splits packages by status' do package = Package.new(stock_location) 4.times { package.add build(:inventory_unit, variant: variant) } 5.times { package.add build(:inventory_unit, variant: variant), :backordered } packages = subject.split([package]) expect(packages.count).to eq 2 expect(packages.first.quantity).to eq 4 expect(packages.first.on_hand.count).to eq 4 expect(packages.first.backordered.count).to eq 0 expect(packages[1].contents.count).to eq 5 end end end end end
Version data entries
48 entries across 48 versions & 2 rubygems