diff --git a/app/services/bulk_upload/lettings/row_parser.rb b/app/services/bulk_upload/lettings/row_parser.rb index c59409144..a6c999fe6 100644 --- a/app/services/bulk_upload/lettings/row_parser.rb +++ b/app/services/bulk_upload/lettings/row_parser.rb @@ -205,7 +205,7 @@ private next if log.optional_fields.include?(question.id) next if question.completed?(log) - fields.each { |field| errors.add(field, :blank) } + fields.each { |field| errors.add(field, I18n.t("validations.not_answered", question: question.check_answer_label&.downcase)) } end end diff --git a/spec/services/bulk_upload/lettings/row_parser_spec.rb b/spec/services/bulk_upload/lettings/row_parser_spec.rb index 66bdee6c5..4b4795348 100644 --- a/spec/services/bulk_upload/lettings/row_parser_spec.rb +++ b/spec/services/bulk_upload/lettings/row_parser_spec.rb @@ -279,6 +279,10 @@ RSpec.describe BulkUpload::Lettings::RowParser do it "returns an error" do expect(parser.errors[:field_103]).to be_present end + + it "populates with correct error message" do + expect(parser.errors[:field_103]).to eql(["You must answer type of building"]) + end end context "when unpermitted values" do