From 5b942e6933f2d00587acda8a2f771b2172a81519 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Fri, 7 Feb 2020 15:49:26 +1100 Subject: [PATCH] Add spec for "continue shopping" from cart https://github.com/openfoodfoundation/openfoodnetwork/issues/4771 --- spec/features/consumer/shopping/cart_spec.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/spec/features/consumer/shopping/cart_spec.rb b/spec/features/consumer/shopping/cart_spec.rb index 3f1d78c215..424ba45faa 100644 --- a/spec/features/consumer/shopping/cart_spec.rb +++ b/spec/features/consumer/shopping/cart_spec.rb @@ -20,6 +20,26 @@ feature "full-page cart", js: true do set_order order end + describe "continue shopping" do + it "shows a button leading back to the shop" do + # Set up a shopfront message to test that we are not going to the + # home tab. + # PENDING: this passes only without home tab! + #distributor.preferred_shopfront_message = "Test driven farming" + + add_product_to_cart order, product_with_fee, quantity: 2 + visit main_app.cart_path + + expect(page).to have_link "Continue shopping" + + click_link "Continue shopping" + + expect(page).to have_no_link "Continue shopping" + expect(page).to have_button "Edit your cart" + #expect(page).to have_no_content distributor.preferred_shopfront_message + end + end + describe "product description" do it "does not link to the product page" do add_product_to_cart order, product_with_fee, quantity: 2