From f73989af6ae389e7d971650ae73bcc4a462cc923 Mon Sep 17 00:00:00 2001 From: Kat Date: Tue, 25 Jun 2024 12:04:19 +0100 Subject: [PATCH] Update confirm and continue button --- app/views/form/check_errors.html.erb | 2 +- spec/requests/check_errors_controller_spec.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/form/check_errors.html.erb b/app/views/form/check_errors.html.erb index 03e5c231e..f50ddf6c1 100644 --- a/app/views/form/check_errors.html.erb +++ b/app/views/form/check_errors.html.erb @@ -61,6 +61,6 @@ <% end %> - <%= govuk_button_link_to "Confirm and continue", "/" %> + <%= govuk_button_link_to "Confirm and continue", @original_page_id ? send("#{@log.model_name.param_key}_#{@original_page_id}_path", @log) : send("#{@log.model_name.param_key}_#{@page.id}_path", @log) %> diff --git a/spec/requests/check_errors_controller_spec.rb b/spec/requests/check_errors_controller_spec.rb index af79114de..179897008 100644 --- a/spec/requests/check_errors_controller_spec.rb +++ b/spec/requests/check_errors_controller_spec.rb @@ -294,6 +294,7 @@ RSpec.describe CheckErrorsController, type: :request do expect(request.query_parameters["check_errors"]).to eq("true") expect(request.query_parameters["related_question_ids"]).to eq(%w[hhmemb ecstat1 earnings]) expect(page).to have_content("You have successfully updated Number of household members") + expect(page).to have_link("Confirm and continue", href: "/lettings-logs/#{lettings_log.id}/household-members") end end @@ -321,6 +322,7 @@ RSpec.describe CheckErrorsController, type: :request do expect(request.query_parameters["check_errors"]).to eq("true") expect(request.query_parameters["related_question_ids"]).to eq(%w[income1 la ownershipsch]) expect(page).to have_content("You have successfully updated Buyer 1’s gross annual income known? and Buyer 1’s gross annual income") + expect(page).to have_link("Confirm and continue", href: "/sales-logs/#{sales_log.id}/buyer-1-income") end end end