From eb51b87beaf7d51126adecf9434df8f500def442 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Mon, 4 May 2020 14:21:58 +0200 Subject: [PATCH] Add spec for current soft deletion behaviour in OrderCycle#variants_distributed_by scope --- spec/models/order_cycle_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/models/order_cycle_spec.rb b/spec/models/order_cycle_spec.rb index 42fc875911..22cfeb2b70 100644 --- a/spec/models/order_cycle_spec.rb +++ b/spec/models/order_cycle_spec.rb @@ -227,6 +227,14 @@ describe OrderCycle do expect(oc.variants_distributed_by(d2)).not_to include p1_v_hidden, p1_v_deleted expect(oc.variants_distributed_by(d1)).to include p2_v end + + context "with soft-deleted variants" do + it "does not consider soft-deleted variants to be currently distributed in the oc" do + p2_v.delete + + expect(oc.variants_distributed_by(d1)).to_not include p2_v + end + end end context "when hub prefers product selection from inventory only" do