From f3ff835902ec27533b7ede42ec9c80866abeccd4 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Sat, 11 Jun 2022 09:00:19 +0100 Subject: [PATCH] Adds a spec to assert on the order state change --- spec/system/consumer/split_checkout_spec.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/spec/system/consumer/split_checkout_spec.rb b/spec/system/consumer/split_checkout_spec.rb index f6a544a369..50a2299d25 100644 --- a/spec/system/consumer/split_checkout_spec.rb +++ b/spec/system/consumer/split_checkout_spec.rb @@ -877,6 +877,21 @@ describe "As a consumer, I want to checkout my order", js: true do expect(page).to have_current_path checkout_step_path(:payment) end end + + describe "order state" do + before do + visit checkout_step_path(:summary) + end + + it "emptying the cart changes the order state back to address" do + pending "fixing issue #9299" + visit main_app.cart_path + expect { + find('#clear_cart_link').click + expect(page).to have_current_path enterprise_shop_path(distributor) + }.to change { order.reload.state }.from("confirmation").to("address") + end + end end context "with previous open orders" do