diff --git a/app/controllers/schemes_controller.rb b/app/controllers/schemes_controller.rb index b59ee9864..6ce8110dc 100644 --- a/app/controllers/schemes_controller.rb +++ b/app/controllers/schemes_controller.rb @@ -136,7 +136,7 @@ class SchemesController < ApplicationController validation_errors scheme_params if @scheme.errors.empty? && @scheme.update(scheme_params) - if scheme_params[:confirmed] == "true" + if scheme_params[:confirmed] == "true" || @scheme.confirmed? @scheme.locations.update!(confirmed: true) flash[:notice] = if scheme_previously_confirmed "#{@scheme.service_name} has been updated." diff --git a/spec/features/schemes_spec.rb b/spec/features/schemes_spec.rb index c2c84f94b..8cf2ab43d 100644 --- a/spec/features/schemes_spec.rb +++ b/spec/features/schemes_spec.rb @@ -781,15 +781,10 @@ RSpec.describe "Schemes scheme Features" do click_button "Save changes" end - it "lets me see amended details on the check answers page" do + it "lets me see amended details on the details page" do expect(page).to have_content "FooBar" - expect(page).to have_current_path("/schemes/#{scheme.id}/check-answers") - assert_selector "a", text: "Change", count: 11 - end - - it "lets me save the scheme" do - click_button "Save" expect(page).to have_current_path("/schemes/#{scheme.id}") + assert_selector "a", text: "Change", count: 11 expect(page).to have_css(".govuk-notification-banner.govuk-notification-banner--success") expect(page).to have_content("has been updated") end @@ -1069,9 +1064,9 @@ RSpec.describe "Schemes scheme Features" do click_button "Save changes" end - it "lets me see amended details on the check answers page" do + it "lets me see amended details on the details page" do expect(page).to have_content "FooBar" - expect(page).to have_current_path("/schemes/#{scheme.id}/check-answers") + expect(page).to have_current_path("/schemes/#{scheme.id}") expect(page).to have_link("Change", href: /schemes\/#{scheme.id}\/edit-name/, count: 3) end end