@ -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 },
@ -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,
@ -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"
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}")
@ -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 } }
it "renders scheme show page after successful update" do