errors.add(location_field,"#{scheme_or_management_group.capitalize} code must relate to a #{location_or_scheme} that is owned by owning organisation or managing organisation",category::setup)
errors.add(location_field,"#{location_or_scheme.capitalize} could not be found with the provided #{scheme_or_management_group} code",category::setup)
block_log_creation!
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 your organisation, or any of your stock owners / managing agents",category::setup)
errors.add(scheme_field,"This #{scheme_or_management_group} code does not belong to the owning organisation or managing organisation",category::setup)
expect(parser.errors.where(:field_4,category::setup).map(&:message)).toinclude("This management group code does not belong to your organisation, or any of your stock owners / managing agents")
expect(parser.errors.where(:field_4,category::setup).map(&:message)).toinclude("This management group code does not belong to the owning organisation or managing organisation")
@ -727,11 +729,12 @@ RSpec.describe BulkUpload::Lettings::Year2022::RowParser do
field_4:scheme.old_visible_id,
field_4:scheme.old_visible_id,
field_5:location.old_visible_id,
field_5:location.old_visible_id,
field_111:owning_org.old_visible_id,
field_111:owning_org.old_visible_id,
field_113:owning_org.old_visible_id,
}
}
end
end
it"returns as setup error"do
it"returns as setup error"do
expect(parser.errors.where(:field_5,category::setup).map(&:message)).toeql(["Location could not be found with the provided scheme code"])
expect(parser.errors.where(:field_5,category::setup).map(&:message)).toeql(["Scheme code must relate to a scheme that is owned by the owning organisation or managing organisation"])
end
end
end
end
end
end
@ -880,7 +883,7 @@ RSpec.describe BulkUpload::Lettings::Year2022::RowParser do
describe"#field_78"do# referral
describe"#field_78"do# referral
context"when 3 ie PRP nominated by LA and owning org is LA"do
context"when 3 ie PRP nominated by LA and owning org is LA"do
expect(parser.errors.where(:field_16,category::setup).map(&:message)).toeq(["The scheme code is not correct"])
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_17,category::setup).map(&:message)).toeq(["Location could not be found with the provided scheme code"])
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 could not be found with the provided scheme code"])
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_16,category::setup).map(&:message)).toeq(["This scheme code does not belong to your organisation, or any of your stock owners / managing agents"])
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_15,category::setup).map(&:message)).toeq(["The management group code is not correct"])
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_16,category::setup).map(&:message)).toeq(["Scheme could not be found with the provided management group code"])
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 could not be found with the provided management group code"])
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
@ -1007,17 +1007,17 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do
expect(parser.errors.where(:field_15,category::setup).map(&:message)).toeq(["This management group code does not belong to your organisation, or any of your stock owners / managing agents"])
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"])