mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-09 23:06:06 +00:00
Adds a spec to assert on the order state change
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user