diff --git a/app/models/scheme.rb b/app/models/scheme.rb index 624a3a428..13f090797 100644 --- a/app/models/scheme.rb +++ b/app/models/scheme.rb @@ -130,7 +130,7 @@ class Scheme < ApplicationRecord def display_attributes [ { name: "Service code", value: id_to_display }, - { name: "Name", value: service_name, edit: true}, + { name: "Name", value: service_name, edit: true }, { name: "Confidential information", value: sensitive, edit: true }, { name: "Housing stock owned by", value: owning_organisation.name, edit: true }, { name: "Managed by", value: managing_organisation&.name }, diff --git a/app/views/schemes/edit_name.html.erb b/app/views/schemes/edit_name.html.erb index 4c4e64ef3..3ddd322fd 100644 --- a/app/views/schemes/edit_name.html.erb +++ b/app/views/schemes/edit_name.html.erb @@ -18,8 +18,6 @@ label: { text: "Scheme name", size: "m" }, hint: { text: "This is how you’ll refer to this supported housing scheme within your organisation. For example, the name could relate to the address or location. You’ll be able to see the client group when selecting it." } %> - - <%= f.govuk_check_boxes_fieldset :sensitive, legend: { text: "This scheme contains confidential information" } do %> <%= f.govuk_check_box :sensitive, diff --git a/spec/features/schemes_spec.rb b/spec/features/schemes_spec.rb index 9e11edcd6..a392d6f1b 100644 --- a/spec/features/schemes_spec.rb +++ b/spec/features/schemes_spec.rb @@ -707,6 +707,19 @@ RSpec.describe "Schemes scheme Features" do expect(page).to have_current_path("/schemes/#{scheme.id}/edit-name") expect(page).to have_content "Scheme details" end + + context "when I edit details" do + before do + fill_in "Scheme name", with: "FooBar" + check "This scheme contains confidential information" + click_button "Save and continue" + end + + it "lets me see amended details on the show page" do + expect(page).to have_content "FooBar" + expect(page).to have_current_path("/schemes/#{scheme.id}") + end + end end end end diff --git a/spec/requests/schemes_controller_spec.rb b/spec/requests/schemes_controller_spec.rb index 76b8d71f1..2d92c7385 100644 --- a/spec/requests/schemes_controller_spec.rb +++ b/spec/requests/schemes_controller_spec.rb @@ -832,7 +832,7 @@ RSpec.describe SchemesController, type: :request do { scheme: { service_name: "testy", sensitive: "1", page: "edit-name", - owning_organisation_id: another_organisation.id} } + owning_organisation_id: another_organisation.id } } end it "renders scheme show page after successful update" do