|
|
@ -49,8 +49,6 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do |
|
|
|
FormHandler.instance.use_real_forms! |
|
|
|
FormHandler.instance.use_real_forms! |
|
|
|
|
|
|
|
|
|
|
|
example.run |
|
|
|
example.run |
|
|
|
|
|
|
|
|
|
|
|
FormHandler.instance.use_fake_forms! |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
describe "#blank_row?" do |
|
|
|
describe "#blank_row?" do |
|
|
@ -1077,6 +1075,20 @@ RSpec.describe BulkUpload::Lettings::Year2023::RowParser do |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "when a soft validation is triggered that relates both to fields that are and are not routed to" do |
|
|
|
|
|
|
|
let(:attributes) { setup_section_params.merge({ field_82: "1", field_47: "M", field_53: "M", field_57: "M" }) } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "adds errors to fields that are routed to" do |
|
|
|
|
|
|
|
expect(parser.errors.where(:field_53, category: :soft_validation)).to be_present |
|
|
|
|
|
|
|
expect(parser.errors.where(:field_57, category: :soft_validation)).to be_present |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "does not add errors to fields that are not routed to" do |
|
|
|
|
|
|
|
expect(parser.errors.where(:field_61, category: :soft_validation)).not_to be_present |
|
|
|
|
|
|
|
expect(parser.errors.where(:field_65, category: :soft_validation)).not_to be_present |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when soft validation is triggered and not required" do |
|
|
|
context "when soft validation is triggered and not required" do |
|
|
|
let(:attributes) { setup_section_params.merge({ field_128: 120, field_126: 1, field_32: 1, field_4: 1, field_5: "3", field_25: "E09000008" }) } |
|
|
|
let(:attributes) { setup_section_params.merge({ field_128: 120, field_126: 1, field_32: 1, field_4: 1, field_5: "3", field_25: "E09000008" }) } |
|
|
|
|
|
|
|
|
|
|
|