Browse Source

lint

pull/717/head
JG 3 years ago
parent
commit
e3b060256d
  1. 2
      app/models/scheme.rb
  2. 2
      app/views/schemes/edit_name.html.erb
  3. 13
      spec/features/schemes_spec.rb
  4. 2
      spec/requests/schemes_controller_spec.rb

2
app/models/scheme.rb

@ -130,7 +130,7 @@ class Scheme < ApplicationRecord
def display_attributes def display_attributes
[ [
{ name: "Service code", value: id_to_display }, { 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: "Confidential information", value: sensitive, edit: true },
{ name: "Housing stock owned by", value: owning_organisation.name, edit: true }, { name: "Housing stock owned by", value: owning_organisation.name, edit: true },
{ name: "Managed by", value: managing_organisation&.name }, { name: "Managed by", value: managing_organisation&.name },

2
app/views/schemes/edit_name.html.erb

@ -18,8 +18,6 @@
label: { text: "Scheme name", size: "m" }, 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." } %> 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, <%= f.govuk_check_boxes_fieldset :sensitive,
legend: { text: "This scheme contains confidential information" } do %> legend: { text: "This scheme contains confidential information" } do %>
<%= f.govuk_check_box :sensitive, <%= f.govuk_check_box :sensitive,

13
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_current_path("/schemes/#{scheme.id}/edit-name")
expect(page).to have_content "Scheme details" expect(page).to have_content "Scheme details"
end 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 end
end end

2
spec/requests/schemes_controller_spec.rb

@ -832,7 +832,7 @@ RSpec.describe SchemesController, type: :request do
{ scheme: { service_name: "testy", { scheme: { service_name: "testy",
sensitive: "1", sensitive: "1",
page: "edit-name", page: "edit-name",
owning_organisation_id: another_organisation.id} } owning_organisation_id: another_organisation.id } }
end end
it "renders scheme show page after successful update" do it "renders scheme show page after successful update" do

Loading…
Cancel
Save