Browse Source

Update specs

pull/1788/head
Jack S 3 years ago
parent
commit
30a9bf95fa
  1. 21
      spec/models/organisation_spec.rb
  2. 8
      spec/requests/organisations_controller_spec.rb

21
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

8
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

Loading…
Cancel
Save