Browse Source

Do not display save buttons (#2072)

pull/2079/head
kosiakkatrina 1 year ago committed by GitHub
parent
commit
fdf6bb87b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/views/form/page.html.erb
  2. 1
      spec/features/form/validations_spec.rb

2
app/views/form/page.html.erb

@ -63,6 +63,7 @@
<%= f.hidden_field :interruption_page_referrer_type, value: @interruption_page_referrer_type %> <%= f.hidden_field :interruption_page_referrer_type, value: @interruption_page_referrer_type %>
<div class="govuk-button-group"> <div class="govuk-button-group">
<% if !@page.interruption_screen? %>
<% if accessed_from_duplicate_logs?(request.query_parameters["referrer"]) %> <% if accessed_from_duplicate_logs?(request.query_parameters["referrer"]) %>
<%= f.govuk_submit "Save changes" %> <%= f.govuk_submit "Save changes" %>
<%= govuk_link_to "Cancel", send("#{@log.class.name.underscore}_duplicate_logs_path", @log, original_log_id: request.query_parameters["original_log_id"]) %> <%= govuk_link_to "Cancel", send("#{@log.class.name.underscore}_duplicate_logs_path", @log, original_log_id: request.query_parameters["original_log_id"]) %>
@ -76,6 +77,7 @@
(@page.skip_href(@log) || send(@log.form.next_page_redirect_path(@page, @log, current_user), @log)), (@page.skip_href(@log) || send(@log.form.next_page_redirect_path(@page, @log, current_user), @log)),
) %> ) %>
<% end %> <% end %>
<% end %>
</div> </div>
</div> </div>
</div> </div>

1
spec/features/form/validations_spec.rb

@ -149,6 +149,7 @@ RSpec.describe "validations" do
expect(page).to have_current_path("/lettings-logs/#{lettings_log.id}/net-income-value-check") expect(page).to have_current_path("/lettings-logs/#{lettings_log.id}/net-income-value-check")
expect(page).to have_content("You told us the lead tenant’s income is £750.00 weekly.") expect(page).to have_content("You told us the lead tenant’s income is £750.00 weekly.")
expect(page).to have_content("This is higher than we would expect for their working situation.") expect(page).to have_content("This is higher than we would expect for their working situation.")
expect(page).not_to have_button("Save changes")
click_button("Confirm and continue") click_button("Confirm and continue")
expect(page).to have_current_path("/lettings-logs/#{lettings_log.id}/net-income-uc-proportion") expect(page).to have_current_path("/lettings-logs/#{lettings_log.id}/net-income-uc-proportion")
end end

Loading…
Cancel
Save