Skip to content

Commit

Permalink
Merge pull request #6754 from alphagov/redirect-married-abroad
Browse files Browse the repository at this point in the history
Redirect Marriage Abroad start page to new flow
  • Loading branch information
Tetrino authored Apr 17, 2024
2 parents 991a716 + 571d53e commit 8558b65
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/flows/marriage_abroad_flow/start.erb
Original file line number Diff line number Diff line change
@@ -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 %>
Expand Down
4 changes: 3 additions & 1 deletion app/presenters/flow_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 11 additions & 0 deletions test/unit/flow_presenter_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8558b65

Please sign in to comment.