Adds a spec to assert on the order state change

This commit is contained in:
filipefurtad0
2022-06-11 09:00:19 +01:00
parent 9fee4f1554
commit f3ff835902

View File

@@ -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