mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Should link to order.distributor website
- order: the order summary the customer is seeing on this page - current_order: the order is the customer is check-outing + add specs
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
= t(:order_back_to_store)
|
||||
.columns.small-12.medium-6
|
||||
- if @order.distributor.website.present?
|
||||
= link_to_service "https://", current_order.distributor.website, class: "button expand" do
|
||||
= link_to_service "https://", @order.distributor.website, class: "button expand" do
|
||||
= t(:order_back_to_website)
|
||||
- else
|
||||
|
||||
|
||||
@@ -56,6 +56,17 @@ describe "Order Management", js: true do
|
||||
visit order_path(order)
|
||||
expect(page).to be_confirmed_order_page
|
||||
end
|
||||
|
||||
it "allows the user to see a link to distributor website when distributor has one" do
|
||||
distributor.update!(website: "www.example.com")
|
||||
visit order_path(order, order_token: order.token)
|
||||
expect(page).to have_link "Back To Website", href: "https://www.example.com"
|
||||
end
|
||||
|
||||
it "doesn't show any link if the distributor doesn't have a website" do
|
||||
visit order_path(order, order_token: order.token)
|
||||
expect(page).not_to have_link "Back To Website"
|
||||
end
|
||||
end
|
||||
|
||||
context "when logged in as the customer" do
|
||||
|
||||
Reference in New Issue
Block a user