Sha256: e33633d934e1f17283772488b290d848e3c7125638adaf61e3d9d918d1c157dd
Contents?: true
Size: 860 Bytes
Versions: 32
Compression:
Stored size: 860 Bytes
Contents
require 'spec_helper' module Spree module Stock module Splitter describe Backordered, :type => :model do let(:variant) { build(:variant) } let(:packer) { build(:stock_packer) } subject { Backordered.new(packer) } it 'splits packages by status' do package = Package.new(packer.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
32 entries across 32 versions & 2 rubygems