From 0e6ec911fec476f54703beec78c9a293651a73eb Mon Sep 17 00:00:00 2001 From: Manny Dinssa <44172848+Dinssa@users.noreply.github.com> Date: Wed, 11 Sep 2024 12:58:15 +0100 Subject: [PATCH] Update error messages --- app/services/bulk_upload/lettings/year2024/row_parser.rb | 4 ++-- app/services/bulk_upload/sales/year2024/row_parser.rb | 4 ++-- .../services/bulk_upload/lettings/year2024/row_parser_spec.rb | 4 ++-- spec/services/bulk_upload/sales/year2024/row_parser_spec.rb | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/services/bulk_upload/lettings/year2024/row_parser.rb b/app/services/bulk_upload/lettings/year2024/row_parser.rb index 7f463d8c4..89f11f602 100644 --- a/app/services/bulk_upload/lettings/year2024/row_parser.rb +++ b/app/services/bulk_upload/lettings/year2024/row_parser.rb @@ -584,7 +584,7 @@ private def validate_assigned_to_when_support if field_3.blank? && bulk_upload.user.support? block_log_creation! - errors.add(:field_3, :setup, message: "User was not provided") + errors.add(:field_3, :setup, message: I18n.t("validations.not_answered", question: "what is the CORE username of the account this letting log should be assigned to?")) end end @@ -905,7 +905,7 @@ private block_log_creation! if errors[: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) end end diff --git a/app/services/bulk_upload/sales/year2024/row_parser.rb b/app/services/bulk_upload/sales/year2024/row_parser.rb index 6b5b6be2d..11a182e6b 100644 --- a/app/services/bulk_upload/sales/year2024/row_parser.rb +++ b/app/services/bulk_upload/sales/year2024/row_parser.rb @@ -1309,7 +1309,7 @@ private block_log_creation! if errors[: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) end end @@ -1324,7 +1324,7 @@ private def validate_assigned_to_when_support if field_3.blank? && bulk_upload.user.support? block_log_creation! - errors.add(:field_3, :setup, message: "User was not provided") + errors.add(:field_3, :setup, message: I18n.t("validations.not_answered", question: "what is the CORE username of the account this sales log should be assigned to?")) end end diff --git a/spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb b/spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb index 55c442c0d..900a3dbe3 100644 --- a/spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb +++ b/spec/services/bulk_upload/lettings/year2024/row_parser_spec.rb @@ -1454,7 +1454,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do parser = described_class.new(attributes) parser.valid? expect(parser).to be_block_log_creation - expect(parser.errors[:field_1]).to include("You do not have permission to add logs for this owning organisation") + expect(parser.errors[:field_1]).to include("You do not have permission to add logs for this owning organisation.") end end @@ -1471,7 +1471,7 @@ RSpec.describe BulkUpload::Lettings::Year2024::RowParser do it "does not block log creation and does not add an error to field_1" do parser = described_class.new(attributes) parser.valid? - expect(parser.errors[:field_1]).not_to include("You do not have permission to add logs for this owning organisation") + expect(parser.errors[:field_1]).not_to include("You do not have permission to add logs for this owning organisation.") end end end diff --git a/spec/services/bulk_upload/sales/year2024/row_parser_spec.rb b/spec/services/bulk_upload/sales/year2024/row_parser_spec.rb index 50b20bb5e..ff977306d 100644 --- a/spec/services/bulk_upload/sales/year2024/row_parser_spec.rb +++ b/spec/services/bulk_upload/sales/year2024/row_parser_spec.rb @@ -569,7 +569,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do parser = described_class.new(attributes) parser.valid? expect(parser).to be_block_log_creation - expect(parser.errors[:field_1]).to include("You do not have permission to add logs for this owning organisation") + expect(parser.errors[:field_1]).to include("You do not have permission to add logs for this owning organisation.") end end @@ -586,7 +586,7 @@ RSpec.describe BulkUpload::Sales::Year2024::RowParser do it "does not block log creation and does not add an error to field_1" do parser = described_class.new(attributes) parser.valid? - expect(parser.errors[:field_1]).not_to include("You do not have permission to add logs for this owning organisation") + expect(parser.errors[:field_1]).not_to include("You do not have permission to add logs for this owning organisation.") end end end