From a66eb7fe1de3deec56a17a64bb7165a90daf7d81 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 20 Mar 2019 15:02:30 +1100 Subject: [PATCH] Add spec for registration link on Spree pages The `registration_path` helper resolves to `/signup` in Spree controllers due to spree_auth_device > config > routes.rb. We worked around that in: https://github.com/openfoodfoundation/openfoodnetwork/pull/3174 Here we add a spec for this so that we can test more easily if we can remove that workaround or detect it's accidental removal. --- spec/features/consumer/shopping/cart_spec.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spec/features/consumer/shopping/cart_spec.rb b/spec/features/consumer/shopping/cart_spec.rb index 09d4821f1c..fa1014b6af 100644 --- a/spec/features/consumer/shopping/cart_spec.rb +++ b/spec/features/consumer/shopping/cart_spec.rb @@ -20,6 +20,17 @@ feature "full-page cart", js: true do set_order order end + it "shows the right registration link" do + # We have an issue with the registration link within Spree controllers. + # The `registration_path` helper resolves to `/signup` due to + # spree_auth_device > config > routes.rb. This spec verifies that we have + # a solution to that problem. + add_product_to_cart order, product_with_fee + visit spree.cart_path + register_page = window_opened_by { click_link "Register here" } + within_window(register_page) { expect(page).to have_content "Welcome" } + end + describe "product description" do it "does not link to the product page" do add_product_to_cart order, product_with_fee, quantity: 2