From ca62bd5fa47e2cf73295dacaa3625a0ebd5d4742 Mon Sep 17 00:00:00 2001 From: Arthur Campbell Date: Tue, 28 Mar 2023 10:44:38 +0100 Subject: [PATCH] alter copy to avoid redundant repetition in validaiton message --- app/models/form/sales/questions/savings.rb | 2 +- spec/models/form/sales/questions/savings_spec.rb | 2 +- spec/models/validations/shared_validations_spec.rb | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/models/form/sales/questions/savings.rb b/app/models/form/sales/questions/savings.rb index 82ed8f6c9..6c01ed2fd 100644 --- a/app/models/form/sales/questions/savings.rb +++ b/app/models/form/sales/questions/savings.rb @@ -2,7 +2,7 @@ class Form::Sales::Questions::Savings < ::Form::Question def initialize(id, hsh, page) super @id = "savings" - @check_answer_label = "Buyer’s total savings (to nearest £10) before any deposit paid" + @check_answer_label = "Buyer’s total savings before any deposit paid" @header = "Enter their total savings to the nearest £10" @type = "numeric" @width = 5 diff --git a/spec/models/form/sales/questions/savings_spec.rb b/spec/models/form/sales/questions/savings_spec.rb index 3241d5a62..8e9c4daa4 100644 --- a/spec/models/form/sales/questions/savings_spec.rb +++ b/spec/models/form/sales/questions/savings_spec.rb @@ -20,7 +20,7 @@ RSpec.describe Form::Sales::Questions::Savings, type: :model do end it "has the correct check_answer_label" do - expect(question.check_answer_label).to eq("Buyer’s total savings (to nearest £10) before any deposit paid") + expect(question.check_answer_label).to eq("Buyer’s total savings before any deposit paid") end it "has the correct type" do diff --git a/spec/models/validations/shared_validations_spec.rb b/spec/models/validations/shared_validations_spec.rb index 88c73934a..85f0f96b4 100644 --- a/spec/models/validations/shared_validations_spec.rb +++ b/spec/models/validations/shared_validations_spec.rb @@ -90,7 +90,7 @@ RSpec.describe Validations::SharedValidations do it "adds the correct validation text when a question has a min but not a max" do sales_log.savings = -10 shared_validator.validate_numeric_min_max(sales_log) - expect(sales_log.errors["savings"]).to include(match I18n.t("validations.numeric.above_min", field: "Buyer’s total savings (to nearest £10) before any deposit paid", min: "£0")) + expect(sales_log.errors["savings"]).to include(match I18n.t("validations.numeric.above_min", field: "Buyer’s total savings before any deposit paid", min: "£0")) end context "when validating percent" do @@ -139,13 +139,13 @@ RSpec.describe Validations::SharedValidations do it "adds an error if input is not a multiple of ten" do sales_log.savings = 30_005 shared_validator.validate_numeric_step(sales_log) - expect(sales_log.errors[:savings]).to include I18n.t("validations.numeric.nearest_ten", field: "Buyer’s total savings (to nearest £10) before any deposit paid") + expect(sales_log.errors[:savings]).to include I18n.t("validations.numeric.nearest_ten", field: "Buyer’s total savings before any deposit paid") end it "adds an error if the user attempts to input a number in exponent format" do sales_log.savings = "3e5" shared_validator.validate_numeric_step(sales_log) - expect(sales_log.errors[:savings]).to include I18n.t("validations.numeric.nearest_ten", field: "Buyer’s total savings (to nearest £10) before any deposit paid") + expect(sales_log.errors[:savings]).to include I18n.t("validations.numeric.nearest_ten", field: "Buyer’s total savings before any deposit paid") end it "does not add an error if input is a multiple of ten" do