Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect Marriage Abroad start page to new flow #6754

Merged
merged 1 commit into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
mtaylorgds marked this conversation as resolved.
Show resolved Hide resolved
"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
Loading