From 30a9bf95fafd6ab7697c5324233a6702ed6fe21d Mon Sep 17 00:00:00 2001 From: Jack S Date: Wed, 19 Jul 2023 15:48:49 +0100 Subject: [PATCH] Update specs --- spec/models/organisation_spec.rb | 21 ++++++++++--------- .../requests/organisations_controller_spec.rb | 8 +++---- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/spec/models/organisation_spec.rb b/spec/models/organisation_spec.rb index 0cdfc014e..c6179b34f 100644 --- a/spec/models/organisation_spec.rb +++ b/spec/models/organisation_spec.rb @@ -236,16 +236,17 @@ RSpec.describe Organisation, type: :model do it "does not include data protection agreement" do expect(organisation.display_organisation_attributes).to eq( - [{ editable: true, name: "Name", value: "DLUHC" }, - { editable: false, name: "Organisation ID", value: "ORG#{organisation.id}" }, - { editable: true, - name: "Address", - value: "2 Marsham Street\nLondon\nSW1P 4DF" }, - { editable: true, name: "Telephone number", value: nil }, - { editable: false, name: "Type of provider", value: "Local authority" }, - { editable: false, name: "Registration number", value: "1234" }, - { editable: false, format: :bullet, name: "Rent periods", value: %w[All] }, - { editable: false, name: "Owns housing stock", value: "Yes" }], + [ + { editable: false, name: "Organisation ID", value: "ORG#{organisation.id}" }, + { editable: true, + name: "Address", + value: "2 Marsham Street\nLondon\nSW1P 4DF" }, + { editable: true, name: "Telephone number", value: nil }, + { editable: false, name: "Type of provider", value: "Local authority" }, + { editable: false, name: "Registration number", value: "1234" }, + { editable: false, format: :bullet, name: "Rent periods", value: %w[All] }, + { editable: false, name: "Owns housing stock", value: "Yes" }, + ], ) end end diff --git a/spec/requests/organisations_controller_spec.rb b/spec/requests/organisations_controller_spec.rb index 7ba7be1b2..896f760ba 100644 --- a/spec/requests/organisations_controller_spec.rb +++ b/spec/requests/organisations_controller_spec.rb @@ -262,9 +262,9 @@ RSpec.describe OrganisationsController, type: :request do expect(response.body).to include(organisation.name) end - it "has a change details link" do + it "does not include a change details link" do expected_html = "data-qa=\"change-name\" href=\"/organisations/#{organisation.id}/edit\"" - expect(response.body).to include(expected_html) + expect(response.body).not_to include(expected_html) end it "displays a link to merge organisations" do @@ -345,9 +345,9 @@ RSpec.describe OrganisationsController, type: :request do get "/organisations/#{organisation.id}/edit", headers:, params: {} end - it "shows an edit form" do + it "shows an edit form without name field" do expect(response.body).to include("Change #{organisation.name}’s details") - expect(page).to have_field("organisation-name-field") + expect(page).not_to have_field("organisation-name-field") expect(page).to have_field("organisation-phone-field") end end