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.
This commit is contained in:
Maikel Linke
2019-03-20 15:02:30 +11:00
parent fb29a7c7c2
commit a66eb7fe1d

View File

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