@ -445,7 +445,7 @@ RSpec.describe "bulk_update" do
expect(Rails.logger).toreceive(:info).with("Will not export log #{lettings_log_5.id} as it is before the exportable date")
expect(Rails.logger).toreceive(:info).with("No changes to location #{locations[1].id}.")
expect(Rails.logger).toreceive(:info).with("Cannot update location #{locations[2].id} with postcode: SWAAA. Enter a postcode in the correct format, for example AA1 1AA")
expect(Rails.logger).toreceive(:info).with("Cannot update location #{locations[2].id} with postcode: SWAAA. Enter a postcode in the correct format, for example AA1 1AA.")
expect(Rails.logger).toreceive(:info).with("Cannot update location #{locations[2].id} with scheme_code: S. Scheme with id S is not in the database")
expect(Rails.logger).toreceive(:info).with("Cannot update location #{locations[2].id} with location_admin_district: Westminst. Location admin distrint Westminst is not a valid option")
expect(Rails.logger).toreceive(:info).with("Cannot update location #{locations[2].id} with type_of_unit: elf-contained house. 'elf-contained house' is not a valid type_of_unit")
expect(record.errors["prevten"]).toinclude("Buyer 1’s previous tenure should be “local authority tenant” or “private registered provider or housing association tenant” for discounted sales")
expect(record.errors["ownershipsch"]).toinclude("Buyer 1’s previous tenure should be “local authority tenant” or “private registered provider or housing association tenant” for discounted sales")
expect(record.errors["prevten"]).toinclude("Buyer 1’s previous tenure should be “local authority tenant” or “private registered provider or housing association tenant” for discounted sales.")
expect(record.errors["ownershipsch"]).toinclude("Buyer 1’s previous tenure should be “local authority tenant” or “private registered provider or housing association tenant” for discounted sales.")
end
end
@ -420,7 +420,7 @@ RSpec.describe Validations::Sales::HouseholdValidations do
expect(json_response["errors"]).tomatch_array([["beds",["Number of bedrooms must be 1 if the property is a bedsit"]],["proptype",["Answer cannot be 'Bedsit' if the property has 2 or more bedrooms"]]])
expect(json_response["errors"]).tomatch_array([["beds",["Number of bedrooms must be 1 if the property is a bedsit."]],["proptype",["Answer cannot be 'Bedsit' if the property has 2 or more bedrooms."]]])
@ -686,7 +686,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"cannot be nulled"do
parser.valid?
expect(parser.errors[:field_45]).toeq(["You must show the MHCLG privacy notice to the tenant before you can submit this log"])
expect(parser.errors[:field_45]).toeq(["You must show the MHCLG privacy notice to the tenant before you can submit this log."])
end
end
end
@ -1106,8 +1106,8 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
parser.valid?
expect(parser.errors[:field_15]).tobe_blank
expect(parser.errors.where(:field_16).map(&:message)).toeq(["This location is incomplete. Select another location or update this one"])
expect(parser.errors.where(:field_17).map(&:message)).toeq(["This location is incomplete. Select another location or update this one"])
expect(parser.errors.where(:field_16).map(&:message)).toeq(["This location is incomplete. Select another location or update this one."])
expect(parser.errors.where(:field_17).map(&:message)).toeq(["This location is incomplete. Select another location or update this one."])
end
end
end
@ -1480,7 +1480,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"returns an error"do
parser.valid?
expect(parser.errors[:field_9]).toinclude("Tenancy start year must be 2 digits")
expect(parser.errors[:field_9]).toinclude("Tenancy start year must be 2 digits.")
end
end
@ -2710,8 +2710,8 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"sets error on housingneeds a and b"do
parser.valid?
expect(parser.errors[:field_83]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected")
expect(parser.errors[:field_84]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected")
expect(parser.errors[:field_83]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.")
expect(parser.errors[:field_84]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.")
expect(parser.errors[:field_85]).tobe_blank
end
end
@ -2721,8 +2721,8 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"sets error on housingneeds a and c"do
parser.valid?
expect(parser.errors[:field_83]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected")
expect(parser.errors[:field_85]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected")
expect(parser.errors[:field_83]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.")
expect(parser.errors[:field_85]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.")
expect(parser.errors[:field_84]).tobe_blank
end
end
@ -2732,8 +2732,8 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"sets error on housingneeds b and c"do
parser.valid?
expect(parser.errors[:field_84]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected")
expect(parser.errors[:field_85]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected")
expect(parser.errors[:field_84]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.")
expect(parser.errors[:field_85]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.")
expect(parser.errors[:field_83]).tobe_blank
end
end
@ -2743,8 +2743,8 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"sets error on housingneeds a and g"do
parser.valid?
expect(parser.errors[:field_87]).toinclude("No disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs")
expect(parser.errors[:field_83]).toinclude("No disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs")
expect(parser.errors[:field_87]).toinclude("No disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs.")
expect(parser.errors[:field_83]).toinclude("No disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs.")
expect(parser.errors[:field_84]).tobe_blank
expect(parser.errors[:field_85]).tobe_blank
end
@ -2767,8 +2767,8 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"sets error on housingneeds a and h"do
parser.valid?
expect(parser.errors[:field_88]).toinclude("Don’t know disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs")
expect(parser.errors[:field_83]).toinclude("Don’t know disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs")
expect(parser.errors[:field_88]).toinclude("Don’t know disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs.")
expect(parser.errors[:field_83]).toinclude("Don’t know disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs.")
@ -1844,7 +1844,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"adds an error to field_45"do
parser.valid?
expect(parser.errors["field_45"]).toinclude("Select a valid nationality")
expect(parser.errors["field_45"]).toinclude("Select a valid nationality.")
end
end
end
@ -2813,8 +2813,8 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"sets error on housingneeds a and b"do
parser.valid?
expect(parser.errors[:field_79]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected")
expect(parser.errors[:field_80]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected")
expect(parser.errors[:field_79]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.")
expect(parser.errors[:field_80]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.")
expect(parser.errors[:field_81]).tobe_blank
end
end
@ -2824,8 +2824,8 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"sets error on housingneeds a and c"do
parser.valid?
expect(parser.errors[:field_79]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected")
expect(parser.errors[:field_81]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected")
expect(parser.errors[:field_79]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.")
expect(parser.errors[:field_81]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.")
expect(parser.errors[:field_80]).tobe_blank
end
end
@ -2835,8 +2835,8 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"sets error on housingneeds b and c"do
parser.valid?
expect(parser.errors[:field_80]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected")
expect(parser.errors[:field_81]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected")
expect(parser.errors[:field_80]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.")
expect(parser.errors[:field_81]).toinclude("Only one disabled access need: fully wheelchair-accessible housing, wheelchair access to essential rooms or level access housing, can be selected.")
expect(parser.errors[:field_79]).tobe_blank
end
end
@ -2846,8 +2846,8 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"sets error on housingneeds a and g"do
parser.valid?
expect(parser.errors[:field_83]).toinclude("No disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs")
expect(parser.errors[:field_79]).toinclude("No disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs")
expect(parser.errors[:field_83]).toinclude("No disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs.")
expect(parser.errors[:field_79]).toinclude("No disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs.")
expect(parser.errors[:field_80]).tobe_blank
expect(parser.errors[:field_81]).tobe_blank
end
@ -2870,8 +2870,8 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"sets error on housingneeds a and h"do
parser.valid?
expect(parser.errors[:field_84]).toinclude("Don’t know disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs")
expect(parser.errors[:field_79]).toinclude("Don’t know disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs")
expect(parser.errors[:field_84]).toinclude("Don’t know disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs.")
expect(parser.errors[:field_79]).toinclude("Don’t know disabled access needs can’t be selected if you have selected fully wheelchair-accessible housing, wheelchair access to essential rooms, level access housing or other disabled access needs.")