Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep backorders when splitting part of variant to new shipment with same SL #5670

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Move let statements inside context block
These are already overridden in all other first-level context blocks
so it makes sense to move them in the single block that relies on
these values.
spaghetticode committed Mar 7, 2024
commit 9062828dd152bec2cd9ee915823e668b642bf860
5 changes: 3 additions & 2 deletions core/spec/models/spree/fulfilment_changer_spec.rb
Original file line number Diff line number Diff line change
@@ -21,8 +21,6 @@
let(:current_shipment) { order.shipments.first }
let!(:desired_shipment) { order.shipments.create!(stock_location: desired_stock_location) }
let(:desired_stock_location) { current_shipment.stock_location }
let(:current_shipment_inventory_unit_count) { 1 }
let(:quantity) { current_shipment_inventory_unit_count }

let(:shipment_splitter) do
described_class.new(
@@ -41,6 +39,9 @@
end

context "when the current shipment stock location is the same of the target shipment" do
let(:current_shipment_inventory_unit_count) { 1 }
let(:quantity) { current_shipment_inventory_unit_count }

context "when the stock location is empty" do
before do
variant.stock_items.first.update_column(:count_on_hand, 0)