diff --git a/app/views/form/page.html.erb b/app/views/form/page.html.erb index d764a4690..6c0a64c20 100644 --- a/app/views/form/page.html.erb +++ b/app/views/form/page.html.erb @@ -5,7 +5,6 @@ <% end %>
- <%= form_with model: @case_log, url: form_case_log_path(@case_log), method: "post", local: true do |f| %>
"> @@ -39,9 +38,10 @@ <% end %> <%= f.hidden_field :page, value: @page.id %> + <% if !@page.id.include?("value_check") %> <%= f.govuk_submit "Save and continue" %> - <% if @case_log.status == "in_progress" %> + <% if request.query_parameters["referrer"] == "check_answers" %> <%= govuk_link_to "Cancel", "/logs/#{@case_log.id}/setup/check-answers", secondary: true %> <% else %> <%= govuk_link_to "Skip for now", send(@case_log.form.next_page_redirect_path(@page, @case_log, current_user), @case_log), secondary: true %> diff --git a/spec/features/form/form_navigation_spec.rb b/spec/features/form/form_navigation_spec.rb index 1f7792075..701007623 100644 --- a/spec/features/form/form_navigation_spec.rb +++ b/spec/features/form/form_navigation_spec.rb @@ -62,7 +62,7 @@ RSpec.describe "Form Navigation" do end it "a question page has a link allowing you to cancel your input and return to the check answers page" do - visit("logs/#{id}/tenant-code-test") + visit("logs/#{id}/tenant-code-test?referrer=check_answers") click_link(text: "Cancel") expect(page).to have_current_path("/logs/#{id}/setup/check-answers") end