Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ def edit_question
def routes
page_external_id = params.require(:page_external_id)
page = current_form.pages.find_by!(external_id: page_external_id)
redirect_to show_routes_path(current_form.id, page.id)

if FeatureService.new(group: current_form.group).enabled?(:multiple_branches)
redirect_to routes_path(current_form.id, anchor: page.page_position_id)
else
redirect_to show_routes_path(current_form.id, page.id)
end
end

private
Expand Down
12 changes: 10 additions & 2 deletions spec/requests/forms/redirect_from_forms_runner_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,16 @@
expect(response).to have_http_status(302)
end

it "redirects to the show routes page" do
expect(response).to redirect_to(show_routes_path(form_id: form.id, page_id: page.id))
context "when the multiple branches feature is not enabled", feature_multiple_branches: false do
it "redirects to the show routes page" do
expect(response).to redirect_to(show_routes_path(form_id: form.id, page_id: page.id))
end
end

context "when the multiple branches feature is enabled", :feature_multiple_branches do
it "redirects to the edit routes page" do
expect(response).to redirect_to(routes_path(form_id: form.id, anchor: page.page_position_id))
end
end
end

Expand Down
Loading