mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
Merge pull request #9269 from jibees/fix-@order-distributor-website-in-/order/ORDER_ID-page
As a customer, on an order page, distributor website should link to the order that is actually showing
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