mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-02 02:11:33 +00:00
Merge pull request #11911 from arunguleria/11599-checkout-page-title-changes
Change page title on checkout pages
This commit is contained in:
@@ -148,4 +148,10 @@ module CheckoutHelper
|
||||
]
|
||||
end
|
||||
end
|
||||
|
||||
# Set the Page title of checkout process as step based like
|
||||
# Checkout Details, Checkout Payment and Checkout Summary
|
||||
def checkout_page_title
|
||||
t("checkout_#{checkout_step}_title")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
- content_for(:title) do
|
||||
= t :checkout_title
|
||||
= checkout_page_title
|
||||
|
||||
.darkswarm.footer-pad{"data-turbo": "true"}
|
||||
- content_for :order_cycle_form do
|
||||
|
||||
@@ -2227,6 +2227,9 @@ en:
|
||||
order_back_to_store: Back To Store
|
||||
order_back_to_cart: Back To Cart
|
||||
order_back_to_website: Back To Website
|
||||
checkout_details_title: Checkout Details
|
||||
checkout_payment_title: Checkout Payment
|
||||
checkout_summary_title: Checkout Summary
|
||||
|
||||
bom_tip: "Use this page to alter product quantities across multiple orders. Products may also be removed from orders entirely, if required."
|
||||
|
||||
|
||||
@@ -389,6 +389,10 @@ describe "As a consumer, I want to checkout my order" do
|
||||
end
|
||||
|
||||
it "pre-fills address details" do
|
||||
# Check for the right title first. This is a random place here but
|
||||
# we don't have a standard success checkout flow case to add this to.
|
||||
expect(page).to have_title "Checkout Details - Open Food Network"
|
||||
|
||||
visit checkout_path
|
||||
expect(page).to have_select(
|
||||
"order_bill_address_attributes_state_id", selected: "Testville"
|
||||
|
||||
@@ -62,14 +62,12 @@ describe "As a consumer, I want to checkout my order" do
|
||||
let(:order) { create(:order_ready_for_payment, distributor:) }
|
||||
|
||||
context "with one payment method, with a fee" do
|
||||
before do
|
||||
visit checkout_step_path(:payment)
|
||||
end
|
||||
it "preselect the payment method if only one is available" do
|
||||
expect(page).to have_checked_field "payment_method_#{payment_with_fee.id}"
|
||||
end
|
||||
it "displays the transaction fee" do
|
||||
expect(page).to have_content("#{payment_with_fee.name} " + with_currency(1.23).to_s)
|
||||
visit checkout_step_path(:payment)
|
||||
|
||||
expect(page).to have_title "Checkout Payment - Open Food Network"
|
||||
expect(page).to have_checked_field "Payment with Fee"
|
||||
expect(page).to have_content "Payment with Fee $1.23"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -66,15 +66,16 @@ describe "As a consumer, I want to checkout my order" do
|
||||
visit checkout_step_path(:summary)
|
||||
end
|
||||
|
||||
it "displays the ship address" do
|
||||
it "displays title and ship address" do
|
||||
expect(page).to have_title "Checkout Summary - Open Food Network"
|
||||
|
||||
expect(page).to have_content "Delivery address"
|
||||
expect(page).to have_content order.ship_address.address1
|
||||
expect(page).to have_content order.ship_address.city
|
||||
expect(page).to have_content order.ship_address.zipcode
|
||||
expect(page).to have_content order.ship_address.phone
|
||||
end
|
||||
|
||||
it "and not the billing address" do
|
||||
# but not the billing address
|
||||
expect(page).not_to have_content order.bill_address.address1
|
||||
expect(page).not_to have_content order.bill_address.city
|
||||
expect(page).not_to have_content order.bill_address.zipcode
|
||||
|
||||
Reference in New Issue
Block a user