+
<%= govuk_summary_list do |summary_list| %>
<% @scheme.display_attributes.each do |attr| %>
<% next if current_user.data_coordinator? && attr[:name] == ("Housing stock owned by") %>
diff --git a/spec/factories/location.rb b/spec/factories/location.rb
index 4041fe337..31859a0c1 100644
--- a/spec/factories/location.rb
+++ b/spec/factories/location.rb
@@ -8,6 +8,7 @@ FactoryBot.define do
mobility_type { %w[A M N W X].sample }
location_code { "E09000033" }
location_admin_district { "Westminster" }
+ startdate { Faker::Date.between(from: 6.months.ago, to: Date.today) }
scheme
trait :export do
postcode { "SW1A 2AA" }
diff --git a/spec/features/schemes_helpers.rb b/spec/features/schemes_helpers.rb
index 3814a2f4c..5db3917fa 100644
--- a/spec/features/schemes_helpers.rb
+++ b/spec/features/schemes_helpers.rb
@@ -57,7 +57,10 @@ module SchemesHelpers
def fill_in_and_save_location
fill_in "Postcode", with: "AA1 1AA"
fill_in "Location name (optional)", with: "Some name"
- fill_in "Total number of units at this location", with: 1
+ fill_in "Total number of units at this location", with: 5
+ fill_in "Day", with: 2
+ fill_in "Month", with: 2
+ fill_in "Year", with: 2022
choose "Self-contained house"
choose "location-add-another-location-no-field"
choose "location-mobility-type-none-field"
diff --git a/spec/features/schemes_spec.rb b/spec/features/schemes_spec.rb
index f1b8aafde..4c55a7168 100644
--- a/spec/features/schemes_spec.rb
+++ b/spec/features/schemes_spec.rb
@@ -175,7 +175,7 @@ RSpec.describe "Schemes scheme Features" do
context "when there are locations that belong to the selected scheme" do
let!(:schemes) { FactoryBot.create_list(:scheme, 5) }
let(:scheme) { schemes.first }
- let!(:locations) { FactoryBot.create_list(:location, 3, scheme:, postcode: "AA11AA") }
+ let!(:locations) { FactoryBot.create_list(:location, 3, scheme:, postcode: "AA11AA", startdate: Time.utc(2022,1,1)) }
before do
visit("schemes")
@@ -198,8 +198,7 @@ RSpec.describe "Schemes scheme Features" do
expect(page).to have_content(location.postcode)
expect(page).to have_content(location.units)
expect(page).to have_content(location.type_of_unit)
- expect(page).to have_content(location.mobility_type)
- expect(page).to have_content(location.location_admin_district)
+ expect(page).to have_content(location.startdate&.to_formatted_s(:govuk_date))
end
end
end
@@ -471,10 +470,9 @@ RSpec.describe "Schemes scheme Features" do
it "displays information about the first created location" do
expect(page).to have_content "AA11AA"
expect(page).to have_content "Some name"
+ expect(page).to have_content "5"
expect(page).to have_content "Self-contained house"
- expect(page).to have_content "None"
- expect(page).to have_content "Local authority"
- expect(page).to have_content "Westminster"
+ expect(page).to have_content "2 February 2022"
end
it "displays information about another location" do
@@ -508,7 +506,6 @@ RSpec.describe "Schemes scheme Features" do
expect(page).to have_content "Locations"
expect(page).to have_content "#{scheme.locations.count} location"
expect(page).to have_content "ZZ11ZZ"
- expect(page).to have_content("Wheelchair-user standard")
end
end
diff --git a/spec/requests/locations_controller_spec.rb b/spec/requests/locations_controller_spec.rb
index ea9018c0c..bd0aee42c 100644
--- a/spec/requests/locations_controller_spec.rb
+++ b/spec/requests/locations_controller_spec.rb
@@ -804,7 +804,7 @@ RSpec.describe LocationsController, type: :request do
expect(page).to have_content(location.id)
expect(page).to have_content(location.postcode)
expect(page).to have_content(location.type_of_unit)
- expect(page).to have_content(location.mobility_type)
+ expect(page).to have_content(location.startdate&.to_formatted_s(:govuk_date))
end
end
@@ -906,7 +906,7 @@ RSpec.describe LocationsController, type: :request do
expect(page).to have_content(location.id)
expect(page).to have_content(location.postcode)
expect(page).to have_content(location.type_of_unit)
- expect(page).to have_content(location.mobility_type)
+ expect(page).to have_content(location.startdate&.to_formatted_s(:govuk_date))
end
end