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
end
end
@ -810,7 +810,7 @@ private
block_log_creation!
block_log_creation!
iferrors[:field_2].blank?
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
end
end
end
@ -820,7 +820,7 @@ private
block_log_creation!
block_log_creation!
iferrors[:field_2].blank?
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
end
end
end
@ -828,7 +828,7 @@ private
defvalidate_managing_org_data_given
defvalidate_managing_org_data_given
iffield_2.blank?
iffield_2.blank?
block_log_creation!
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
end
end
@ -837,7 +837,7 @@ private
block_log_creation!
block_log_creation!
iferrors[:field_1].blank?
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
end
end
end
@ -847,7 +847,7 @@ private
block_log_creation!
block_log_creation!
iferrors[:field_1].blank?
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
end
end
end
@ -864,7 +864,7 @@ private
block_log_creation!
block_log_creation!
iferrors[:field_1].blank?
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)
@ -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
it"adds an error to all (and only) the fields used to determine duplicates"do
parser.valid?
parser.valid?
error_message="This is a duplicate log"
error_message="This is a duplicate log."
[
[
:field_1,# owning_organisation
: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
it"adds an error to all the fields used to determine duplicates"do
parser.valid?
parser.valid?
error_message="This is a duplicate log"
error_message="This is a duplicate log."
[
[
:field_1,# owning_organisation
: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
it"adds an error to all the fields used to determine duplicates"do
parser.valid?
parser.valid?
error_message="This is a duplicate log"
error_message="This is a duplicate log."
[
[
:field_1,# owning_organisation
: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
it"adds an error to all the fields used to determine duplicates"do
parser.valid?
parser.valid?
error_message="This is a duplicate log"
error_message="This is a duplicate log."
[
[
:field_1,# owning_organisation
: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
it"does not add an error to all the fields used to determine duplicates"do
parser_too.valid?
parser_too.valid?
error_message="This is a duplicate log"
error_message="This is a duplicate log."
[
[
:field_1,# owning_organisation
: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
it"adds an error to all the fields used to determine duplicates"do
parser.valid?
parser.valid?
error_message="This is a duplicate log"
error_message="This is a duplicate log."
[
[
:field_1,# owning_organisation
: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
it"adds an error to all the fields used to determine duplicates"do
parser.valid?
parser.valid?
error_message="This is a duplicate log"
error_message="This is a duplicate log."
[
[
:field_1,# owning_organisation
: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
it"does not add an error to all the fields used to determine duplicates"do
parser_too.valid?
parser_too.valid?
error_message="This is a duplicate log"
error_message="This is a duplicate log."
[
[
:field_1,# owning_organisation
:field_1,# owning_organisation
@ -979,7 +979,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
parser.valid?
parser.valid?
expect(parser.errors[:field_15]).tobe_blank
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
expect(parser.errors[:field_17]).tobe_blank
end
end
end
end
@ -1018,7 +1018,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
expect(parser.errors[:field_15]).tobe_blank
expect(parser.errors[:field_15]).tobe_blank
expect(parser.errors[:field_16]).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
end
end
@ -1054,7 +1054,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
expect(parser.errors[:field_15]).tobe_blank
expect(parser.errors[:field_15]).tobe_blank
expect(parser.errors[:field_16]).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
end
end
@ -1067,7 +1067,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
parser.valid?
parser.valid?
expect(parser.errors[:field_15]).tobe_blank
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
expect(parser.errors[:field_17]).tobe_blank
end
end
end
end
@ -1122,7 +1122,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"returns a setup error"do
it"returns a setup error"do
parser.valid?
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_16]).tobe_blank
expect(parser.errors[:field_17]).tobe_blank
expect(parser.errors[:field_17]).tobe_blank
end
end
@ -1147,7 +1147,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
parser.valid?
parser.valid?
expect(parser.errors[:field_15]).tobe_blank
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
expect(parser.errors[:field_17]).tobe_blank
end
end
end
end
@ -1173,7 +1173,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
parser.valid?
parser.valid?
expect(parser.errors[:field_15]).tobe_blank
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
expect(parser.errors[:field_17]).tobe_blank
end
end
end
end
@ -1186,7 +1186,7 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
it"returns a setup error"do
it"returns a setup error"do
parser.valid?
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_16]).tobe_blank
expect(parser.errors[:field_17]).tobe_blank
expect(parser.errors[:field_17]).tobe_blank
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
end
it"blocks log creation"do
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.")
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
expect(parser.errors[:field_6]).tobe_blank
end
end
end
end
@ -952,7 +952,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"returns a setup error"do
it"returns a setup error"do
expect(parser.errors[:field_5]).tobe_blank
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
end
end
@ -981,7 +981,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"returns a setup error"do
it"returns a setup error"do
expect(parser.errors[:field_5]).tobe_blank
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
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
expect(parser.errors[:field_6]).tobe_blank
end
end
end
end
@ -1071,7 +1071,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do
it"is not permitted"do
it"is not permitted"do
parser.valid?
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
end
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
end
it"blocks log creation"do
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.")
@ -1121,7 +1121,7 @@ RSpec.describe BulkUpload::Sales::Year2023::RowParser do
it"only adds errors to the discounted ownership field"do
it"only adds errors to the discounted ownership field"do
expect(parser.errors[:field_105]).tobe_empty
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
expect(parser.errors[:field_128]).tobe_empty
end
end
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
end
it"blocks log creation"do
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.")