Skip to content

Commit c22deba

Browse files
authored
Merge pull request #1747 from alphagov/ldeb-change-add-route-to-page-with-routes
Change where add a question route goes if selected question already has a route
2 parents 12343fc + 6f86b85 commit c22deba

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

app/controllers/pages/conditions_controller.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def set_routing_page
1212

1313
if routing_page_input.valid?
1414
routing_page = PageRepository.find(page_id: routing_page_id, form_id: current_form.id)
15-
redirect_to new_condtion_or_skip_path(routing_page)
15+
redirect_to new_condition_or_show_routes_path(routing_page)
1616
else
1717
render template: "pages/conditions/routing_page", locals: { form: current_form, routing_page_input: }, status: :unprocessable_entity
1818
end
@@ -97,9 +97,9 @@ def delete_condition_input_params
9797
params.require(:pages_delete_condition_input).permit(:answer_value, :goto_page_id, :confirm).merge(form: current_form, page:)
9898
end
9999

100-
def new_condtion_or_skip_path(page)
100+
def new_condition_or_show_routes_path(page)
101101
if FeatureService.new(group: current_form.group).enabled?(:branch_routing) && page.routing_conditions.present?
102-
return new_secondary_skip_path(form_id: current_form.id, page_id: page.id)
102+
return show_routes_path(form_id: current_form.id, page_id: page.id)
103103
end
104104

105105
new_condition_path(current_form.id, page.id)

spec/requests/pages/conditions_controller_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@
6868
page
6969
end
7070

71-
it "when branch_routing enabled, redirects the user to the new skip condition page", :feature_branch_routing do
72-
expect(response).to redirect_to new_secondary_skip_path(form.id, selected_page.id)
71+
it "when branch_routing enabled, redirects the user to the question routes page", :feature_branch_routing do
72+
expect(response).to redirect_to show_routes_path(form.id, selected_page.id)
7373
end
7474

7575
it "when branch_routing disabled, redirects the user to the new conditions page" do

0 commit comments

Comments
 (0)