diff --git a/app/helpers/checkout_helper.rb b/app/helpers/checkout_helper.rb index dabbf3d4a6..be967e70ee 100644 --- a/app/helpers/checkout_helper.rb +++ b/app/helpers/checkout_helper.rb @@ -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 diff --git a/app/views/checkout/edit.html.haml b/app/views/checkout/edit.html.haml index b9dab1817f..990c8387b5 100644 --- a/app/views/checkout/edit.html.haml +++ b/app/views/checkout/edit.html.haml @@ -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 diff --git a/config/locales/en.yml b/config/locales/en.yml index 7a51352b98..05ee256012 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -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." diff --git a/spec/system/consumer/checkout/details_spec.rb b/spec/system/consumer/checkout/details_spec.rb index 7492b4721d..218d755301 100644 --- a/spec/system/consumer/checkout/details_spec.rb +++ b/spec/system/consumer/checkout/details_spec.rb @@ -396,6 +396,12 @@ describe "As a consumer, I want to checkout my order" do expect(page).to have_field "order_bill_address_attributes_zipcode", with: "TST01" end end + + describe "show page title as Checkout Details - Open Food Network" do + it "should display title as Checkout Details - Open Food Network" do + page.has_title? "Checkout Details - Open Food Network" + end + end end end end diff --git a/spec/system/consumer/checkout/payment_spec.rb b/spec/system/consumer/checkout/payment_spec.rb index e97bb2e683..ae7529814e 100644 --- a/spec/system/consumer/checkout/payment_spec.rb +++ b/spec/system/consumer/checkout/payment_spec.rb @@ -331,6 +331,12 @@ describe "As a consumer, I want to checkout my order" do end end end + + describe "show page title as Checkout Payment - Open Food Network" do + it "should display title as Checkout Payment - Open Food Network" do + page.has_title? "Checkout Payment - Open Food Network" + end + end end end diff --git a/spec/system/consumer/checkout/summary_spec.rb b/spec/system/consumer/checkout/summary_spec.rb index ac17de5f31..0ddb4905eb 100644 --- a/spec/system/consumer/checkout/summary_spec.rb +++ b/spec/system/consumer/checkout/summary_spec.rb @@ -404,6 +404,12 @@ describe "As a consumer, I want to checkout my order" do end end end + + describe "show page title as Checkout Summary - Open Food Network" do + it "should display title as Checkout Summary - Open Food Network" do + page.has_title? "Checkout Summary - Open Food Network" + end + end end def add_voucher_to_order(voucher, order)