Get tests broken because of new order cycle shipping method validations working again

This commit is contained in:
Cillian O'Ruanaidh
2022-06-08 21:28:37 +01:00
committed by Filipe
parent a46b77d10c
commit 4e0bf75ecf
17 changed files with 134 additions and 70 deletions

View File

@@ -711,9 +711,8 @@ describe Spree::Order do
end
it "keeps the order cycle when it is available at the new distributor" do
d = create(:distributor_enterprise)
oc = create(:simple_order_cycle)
create(:exchange, order_cycle: oc, sender: oc.coordinator, receiver: d, incoming: false)
oc = create(:distributor_order_cycle, with_distributor_and_shipping_method: true)
d = oc.distributors.first
subject.order_cycle = oc
subject.set_distributor! d
@@ -759,7 +758,7 @@ describe Spree::Order do
end
describe "setting the order cycle" do
let(:oc) { create(:simple_order_cycle) }
let(:oc) { create(:distributor_order_cycle, with_distributor_and_shipping_method: true) }
it "empties the cart when changing the order cycle" do
expect(subject).to receive(:empty!)
@@ -777,8 +776,7 @@ describe Spree::Order do
end
it "keeps the distributor when it is available in the new order cycle" do
d = create(:distributor_enterprise)
create(:exchange, order_cycle: oc, sender: oc.coordinator, receiver: d, incoming: false)
d = oc.distributors.first
subject.distributor = d
subject.set_order_cycle! oc