From 571d53ed3b5d935e365e78dd4aaccd3b3128292a Mon Sep 17 00:00:00 2001 From: Jonathon Date: Wed, 17 Apr 2024 11:09:39 +0100 Subject: [PATCH] Redirect Marriage Abroad start page to new flow We can't simply unpublish the old start page as this would remove the entire flow as well - something we don't want to do. As a mitigation, the old start page will now redirect to the new flow until the migration is complete. The old flow landing page has had the name matched with the new landing page to ensure consistency. This must be stripped out ASAP when migration is complete as highest priority. --- app/flows/marriage_abroad_flow/start.erb | 2 +- app/presenters/flow_presenter.rb | 4 +++- test/unit/flow_presenter_test.rb | 11 +++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/flows/marriage_abroad_flow/start.erb b/app/flows/marriage_abroad_flow/start.erb index 8fcc94ef1a1..716d23411ed 100644 --- a/app/flows/marriage_abroad_flow/start.erb +++ b/app/flows/marriage_abroad_flow/start.erb @@ -1,5 +1,5 @@ <% text_for :title do %> - Getting married abroad + Getting married or registering a civil partnership abroad <% end %> <% text_for :meta_description do %> diff --git a/app/presenters/flow_presenter.rb b/app/presenters/flow_presenter.rb index 9a92379527e..e65e10fa638 100644 --- a/app/presenters/flow_presenter.rb +++ b/app/presenters/flow_presenter.rb @@ -55,7 +55,9 @@ def change_answer_link(question, forwarding_responses) end def start_page_link(forwarding_responses) - if response_store + if @flow.name.eql? "marriage-abroad" # Nasty hack to allow migration of old service to new one. Will be stripped asap + "https://www.prove-eligibility-foreign-government.service.gov.uk/before-you-start/which-country-are-you-getting-married-in" + elsif response_store start_flow_path(name, params: forwarding_responses) else smart_answer_path(name) diff --git a/test/unit/flow_presenter_test.rb b/test/unit/flow_presenter_test.rb index c597d5c65a0..d2073f9b2a1 100644 --- a/test/unit/flow_presenter_test.rb +++ b/test/unit/flow_presenter_test.rb @@ -141,4 +141,15 @@ def flow_registry test "#start_page_link returns the start page link for a non response store flow" do assert_equal "/flow-name/y", @flow_presenter.start_page_link({ "key" => "value" }) end + + test "#start_page_link returns the new flow when we're in marriage-abroad" do + @flow = SmartAnswer::Flow.build do + name "marriage-abroad" + end + @flow_presenter = FlowPresenter.new(@flow, nil) + assert_equal( + "https://www.prove-eligibility-foreign-government.service.gov.uk/before-you-start/which-country-are-you-getting-married-in", + @flow_presenter.start_page_link({ "key" => "value" }), + ) + end end