mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-06 22:36:07 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user