* Make full stops consistent in error messages
* Fix test
* Update few hardcoded errors
* Update join in remaining row parsers
* Update some more tests
* Update more hard coded BU errors
* Fix typo I introduced - bedrooms to bedroom
---------
Co-authored-by: Kat <katrina@kosiak.co.uk>
Co-authored-by: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com>
errors.add(location_field,"#{location_or_scheme.capitalize} code must relate to a #{location_or_scheme} that is owned by the owning organisation or managing organisation",category::setup)
errors.add(location_field,"#{location_or_scheme.capitalize} code must relate to a #{location_or_scheme} that is owned by the owning organisation or managing organisation.",category::setup)
errors.add(scheme_field,"This #{scheme_or_management_group} code does not belong to the owning organisation or managing organisation",category::setup)
errors.add(scheme_field,"This #{scheme_or_management_group} code does not belong to the owning organisation or managing organisation.",category::setup)
end
end
@ -810,7 +810,7 @@ private
block_log_creation!
iferrors[:field_2].blank?
errors.add(:field_2,"This managing organisation does not have a relationship with the owning organisation",category::setup)
errors.add(:field_2,"This managing organisation does not have a relationship with the owning organisation.",category::setup)
end
end
end
@ -820,7 +820,7 @@ private
block_log_creation!
iferrors[:field_2].blank?
errors.add(:field_2,"The managing organisation code is incorrect",category::setup)
errors.add(:field_2,"The managing organisation code is incorrect.",category::setup)
end
end
end
@ -828,7 +828,7 @@ private
defvalidate_managing_org_data_given
iffield_2.blank?
block_log_creation!
errors.add(:field_2,"The managing organisation code is incorrect",category::setup)
errors.add(:field_2,"The managing organisation code is incorrect.",category::setup)
end
end
@ -837,7 +837,7 @@ private
block_log_creation!
iferrors[:field_1].blank?
errors.add(:field_1,"The owning organisation code provided is for an organisation that does not own stock",category::setup)
errors.add(:field_1,"The owning organisation code provided is for an organisation that does not own stock.",category::setup)
end
end
end
@ -847,7 +847,7 @@ private
block_log_creation!
iferrors[:field_1].blank?
errors.add(:field_1,"The owning organisation code is incorrect",category::setup)
errors.add(:field_1,"The owning organisation code is incorrect.",category::setup)
end
end
end
@ -864,7 +864,7 @@ private
block_log_creation!
iferrors[:field_1].blank?
errors.add(:field_1,"You do not have permission to add logs for this owning organisation",category::setup)
errors.add(:field_1,"You do not have permission to add logs for this owning organisation.",category::setup)
@ -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(record.errors[:saledate]).toinclude("Enter a date within the 23/24 or 24/25 collection years, which is between 1st April 2023 and 31st March 2025")
expect(record.errors[:saledate]).toinclude("Enter a date within the 23/24 or 24/25 collection years, which is between 1st April 2023 and 31st March 2025.")
end
end
@ -105,7 +105,7 @@ RSpec.describe Validations::Sales::SetupValidations do
expect(record.errors[:saledate]).toinclude("Enter a date within the 23/24 or 24/25 collection years, which is between 1st April 2023 and 31st March 2025")
expect(record.errors[:saledate]).toinclude("Enter a date within the 23/24 or 24/25 collection years, which is between 1st April 2023 and 31st March 2025.")
end
end
@ -119,7 +119,7 @@ RSpec.describe Validations::Sales::SetupValidations do
it"cannot create new logs for the archived collection year"do
expect(record.errors["saledate"]).toinclude(match"Enter a date within the 23/24 or 24/25 collection years, which is between 1st April 2023 and 31st March 2025")
expect(record.errors["saledate"]).toinclude(match"Enter a date within the 23/24 or 24/25 collection years, which is between 1st April 2023 and 31st March 2025.")
end
it"can edit already created logs for the previous collection year"do
@ -127,7 +127,7 @@ RSpec.describe Validations::Sales::SetupValidations do
expect(record.errors["saledate"]).not_toinclude(match"Enter a date within the 24/25 collection year, which is between 1st April 2024 and 31st March 2025")
expect(record.errors["saledate"]).not_toinclude(match"Enter a date within the 24/25 collection year, which is between 1st April 2024 and 31st March 2025.")
end
end
@ -142,7 +142,7 @@ RSpec.describe Validations::Sales::SetupValidations do
expect(record.errors["saledate"]).toinclude(match"Enter a date within the 23/24 or 24/25 collection years, which is between 1st April 2023 and 31st March 2025")
expect(record.errors["saledate"]).toinclude(match"Enter a date within the 23/24 or 24/25 collection years, which is between 1st April 2023 and 31st March 2025.")
end
it"cannot edit already created logs for the archived collection year"do
@ -150,7 +150,7 @@ RSpec.describe Validations::Sales::SetupValidations do
expect(record.errors["saledate"]).toinclude(match"Enter a date within the 23/24 or 24/25 collection years, which is between 1st April 2023 and 31st March 2025")
expect(record.errors["saledate"]).toinclude(match"Enter a date within the 23/24 or 24/25 collection years, which is between 1st April 2023 and 31st March 2025.")
end
end
end
@ -183,7 +183,7 @@ RSpec.describe Validations::Sales::SetupValidations 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."]]])
@ -263,7 +263,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"adds an error to all (and only) the fields used to determine duplicates"do
parser.valid?
error_message="This is a duplicate log"
error_message="This is a duplicate log."
[
:field_1,# owning_organisation
@ -300,7 +300,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"adds an error to all the fields used to determine duplicates"do
parser.valid?
error_message="This is a duplicate log"
error_message="This is a duplicate log."
[
:field_1,# owning_organisation
@ -338,7 +338,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"adds an error to all the fields used to determine duplicates"do
parser.valid?
error_message="This is a duplicate log"
error_message="This is a duplicate log."
[
:field_1,# owning_organisation
@ -385,7 +385,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"adds an error to all the fields used to determine duplicates"do
parser.valid?
error_message="This is a duplicate log"
error_message="This is a duplicate log."
[
:field_1,# owning_organisation
@ -444,7 +444,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"does not add an error to all the fields used to determine duplicates"do
parser_too.valid?
error_message="This is a duplicate log"
error_message="This is a duplicate log."
[
:field_1,# owning_organisation
@ -479,7 +479,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"adds an error to all the fields used to determine duplicates"do
parser.valid?
error_message="This is a duplicate log"
error_message="This is a duplicate log."
[
:field_1,# owning_organisation
@ -526,7 +526,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"adds an error to all the fields used to determine duplicates"do
parser.valid?
error_message="This is a duplicate log"
error_message="This is a duplicate log."
[
:field_1,# owning_organisation
@ -585,7 +585,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"does not add an error to all the fields used to determine duplicates"do
parser_too.valid?
error_message="This is a duplicate log"
error_message="This is a duplicate log."
[
:field_1,# owning_organisation
@ -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
@ -979,7 +979,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
parser.valid?
expect(parser.errors[:field_15]).tobe_blank
expect(parser.errors.where(:field_16,category::setup).map(&:message)).toeq(["This scheme code does not belong to the owning organisation or managing organisation"])
expect(parser.errors.where(:field_16,category::setup).map(&:message)).toeq(["This scheme code does not belong to the owning organisation or managing organisation."])
expect(parser.errors[:field_17]).tobe_blank
end
end
@ -1018,7 +1018,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
expect(parser.errors[:field_15]).tobe_blank
expect(parser.errors[:field_16]).tobe_blank
expect(parser.errors.where(:field_17,category::setup).map(&:message)).toeq(["Location code must relate to a location that is owned by the owning organisation or managing organisation"])
expect(parser.errors.where(:field_17,category::setup).map(&:message)).toeq(["Location code must relate to a location that is owned by the owning organisation or managing organisation."])
end
end
@ -1054,7 +1054,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
expect(parser.errors[:field_15]).tobe_blank
expect(parser.errors[:field_16]).tobe_blank
expect(parser.errors.where(:field_17,category::setup).map(&:message)).toeq(["Location code must relate to a location that is owned by the owning organisation or managing organisation"])
expect(parser.errors.where(:field_17,category::setup).map(&:message)).toeq(["Location code must relate to a location that is owned by the owning organisation or managing organisation."])
end
end
@ -1067,7 +1067,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
parser.valid?
expect(parser.errors[:field_15]).tobe_blank
expect(parser.errors.where(:field_16,category::setup).map(&:message)).toeq(["This scheme code does not belong to the owning organisation or managing organisation"])
expect(parser.errors.where(:field_16,category::setup).map(&:message)).toeq(["This scheme code does not belong to the owning organisation or managing organisation."])
expect(parser.errors[:field_17]).tobe_blank
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
@ -1122,7 +1122,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"returns a setup error"do
parser.valid?
expect(parser.errors.where(:field_15,category::setup).map(&:message)).toeq(["This management group code does not belong to the owning organisation or managing organisation"])
expect(parser.errors.where(:field_15,category::setup).map(&:message)).toeq(["This management group code does not belong to the owning organisation or managing organisation."])
expect(parser.errors[:field_16]).tobe_blank
expect(parser.errors[:field_17]).tobe_blank
end
@ -1147,7 +1147,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
parser.valid?
expect(parser.errors[:field_15]).tobe_blank
expect(parser.errors.where(:field_16,category::setup).map(&:message)).toeq(["Scheme code must relate to a scheme that is owned by the owning organisation or managing organisation"])
expect(parser.errors.where(:field_16,category::setup).map(&:message)).toeq(["Scheme code must relate to a scheme that is owned by the owning organisation or managing organisation."])
expect(parser.errors[:field_17]).tobe_blank
end
end
@ -1173,7 +1173,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
parser.valid?
expect(parser.errors[:field_15]).tobe_blank
expect(parser.errors.where(:field_16,category::setup).map(&:message)).toeq(["Scheme code must relate to a scheme that is owned by the owning organisation or managing organisation"])
expect(parser.errors.where(:field_16,category::setup).map(&:message)).toeq(["Scheme code must relate to a scheme that is owned by the owning organisation or managing organisation."])
expect(parser.errors[:field_17]).tobe_blank
end
end
@ -1186,7 +1186,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"returns a setup error"do
parser.valid?
expect(parser.errors.where(:field_15,category::setup).map(&:message)).toeq(["This management group code does not belong to the owning organisation or managing organisation"])
expect(parser.errors.where(:field_15,category::setup).map(&:message)).toeq(["This management group code does not belong to the owning organisation or managing organisation."])
expect(parser.errors[:field_16]).tobe_blank
expect(parser.errors[:field_17]).tobe_blank
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
@ -1543,7 +1543,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
expect(setup_errors.find{|e|e.attribute==:field_1}.message).toeql("The owning organisation code provided is for an organisation that does not own stock")
expect(setup_errors.find{|e|e.attribute==:field_1}.message).toeql("The owning organisation code provided is for an organisation that does not own stock.")
end
it"blocks log creation"do
@ -1579,7 +1579,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
expect(setup_errors.find{|e|e.attribute==:field_2}.message).toeql("This managing organisation does not have a relationship with the owning organisation")
expect(setup_errors.find{|e|e.attribute==:field_2}.message).toeql("This managing organisation does not have a relationship with the owning organisation.")
end
it"blocks log creation"do
@ -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.")
expect(parser.errors.where(:field_5,category::setup).map(&:message)).toeq(["This scheme code does not belong to the owning organisation or managing organisation"])
expect(parser.errors.where(:field_5,category::setup).map(&:message)).toeq(["This scheme code does not belong to the owning organisation or managing organisation."])
expect(parser.errors[:field_6]).tobe_blank
end
end
@ -952,7 +952,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"returns a setup error"do
expect(parser.errors[:field_5]).tobe_blank
expect(parser.errors.where(:field_6,category::setup).map(&:message)).toeq(["Location code must relate to a location that is owned by the owning organisation or managing organisation"])
expect(parser.errors.where(:field_6,category::setup).map(&:message)).toeq(["Location code must relate to a location that is owned by the owning organisation or managing organisation."])
end
end
@ -981,7 +981,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"returns a setup error"do
expect(parser.errors[:field_5]).tobe_blank
expect(parser.errors.where(:field_6,category::setup).map(&:message)).toeq(["Location code must relate to a location that is owned by the owning organisation or managing organisation"])
expect(parser.errors.where(:field_6,category::setup).map(&:message)).toeq(["Location code must relate to a location that is owned by the owning organisation or managing organisation."])
end
end
@ -991,7 +991,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
expect(parser.errors.where(:field_5,category::setup).map(&:message)).toeq(["This scheme code does not belong to the owning organisation or managing organisation"])
expect(parser.errors.where(:field_5,category::setup).map(&:message)).toeq(["This scheme code does not belong to the owning organisation or managing organisation."])
expect(parser.errors[:field_6]).tobe_blank
end
end
@ -1021,8 +1021,8 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
expect(parser.errors.where(:field_5).map(&:message)).toeq(["This location is incomplete. Select another location or update this one"])
expect(parser.errors.where(:field_6).map(&:message)).toeq(["This location is incomplete. Select another location or update this one"])
expect(parser.errors.where(:field_5).map(&:message)).toeq(["This location is incomplete. Select another location or update this one."])
expect(parser.errors.where(:field_6).map(&:message)).toeq(["This location is incomplete. Select another location or update this one."])
end
end
end
@ -1071,7 +1071,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"is not permitted"do
parser.valid?
expect(parser.errors[:field_98]).toinclude('The reason for leaving must be "End of social or private sector tenancy - no fault", "End of social or private sector tenancy - evicted due to anti-social behaviour (ASB)", "End of social or private sector tenancy - evicted due to rent arrears" or "End of social or private sector tenancy - evicted for any other reason"')
expect(parser.errors[:field_98]).toinclude('The reason for leaving must be "End of social or private sector tenancy - no fault", "End of social or private sector tenancy - evicted due to anti-social behaviour (ASB)", "End of social or private sector tenancy - evicted due to rent arrears" or "End of social or private sector tenancy - evicted for any other reason".')
end
end
end
@ -1297,7 +1297,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"returns an error"do
parser.valid?
expect(parser.errors[:field_10]).toinclude("Tenancy start year must be 2 digits")
expect(parser.errors[:field_10]).toinclude("Tenancy start year must be 2 digits.")
end
end
@ -1365,7 +1365,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
expect(setup_errors.find{|e|e.attribute==:field_1}.message).toeql("The owning organisation code provided is for an organisation that does not own stock")
expect(setup_errors.find{|e|e.attribute==:field_1}.message).toeql("The owning organisation code provided is for an organisation that does not own stock.")
end
it"blocks log creation"do
@ -1403,7 +1403,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
expect(setup_errors.find{|e|e.attribute==:field_2}.message).toeql("This managing organisation does not have a relationship with the owning organisation")
expect(setup_errors.find{|e|e.attribute==:field_2}.message).toeql("This managing organisation does not have a relationship with the owning organisation.")
end
it"blocks log creation"do
@ -1602,7 +1602,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"adds an appropriate error to the UPRN field"do
parser.valid?
expect(parser.errors[:field_16]).toeql(["UPRN must be 12 digits or less"])
expect(parser.errors[:field_16]).toeql(["UPRN must be 12 digits or less."])
end
it"adds errors to missing key address fields"do
@ -1619,7 +1619,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"adds an error to the UPRN field only"do
parser.valid?
expect(parser.errors[:field_16]).toeql(["UPRN must be 12 digits or less"])
expect(parser.errors[:field_16]).toeql(["UPRN must be 12 digits or less."])
@ -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.")
@ -1121,7 +1121,7 @@ RSpec.describe BulkUpload::Sales::Year2023::RowParser do
it"only adds errors to the discounted ownership field"do
expect(parser.errors[:field_105]).tobe_empty
expect(parser.errors[:field_119]).toinclude("Mortgage, deposit, and grant total must equal £90.00. Your given mortgage, deposit and grant total is £100.00")
expect(parser.errors[:field_119]).toinclude("Mortgage, deposit, and grant total must equal £90.00. Your given mortgage, deposit and grant total is £100.00.")
expect(parser.errors[:field_128]).tobe_empty
end
end
@ -1409,7 +1409,7 @@ RSpec.describe BulkUpload::Sales::Year2023::RowParser do
expect(setup_errors.find{|e|e.attribute==:field_2}.message).toeql("This user belongs to an organisation that does not have a relationship with the owning organisation")
expect(setup_errors.find{|e|e.attribute==:field_2}.message).toeql("This user belongs to an organisation that does not have a relationship with the owning organisation.")
end
it"blocks log creation"do
@ -1431,7 +1431,7 @@ RSpec.describe BulkUpload::Sales::Year2023::RowParser do
expect(setup_errors.find{|e|e.attribute==:field_1}.message).toeql("The owning organisation code provided is for an organisation that does not own stock")
expect(setup_errors.find{|e|e.attribute==:field_1}.message).toeql("The owning organisation code provided is for an organisation that does not own stock.")
expect(setup_errors.find{|e|e.attribute==:field_1}.message).toeql("The owning organisation code provided is for an organisation that does not own stock")
expect(setup_errors.find{|e|e.attribute==:field_1}.message).toeql("The owning organisation code provided is for an organisation that does not own stock.")