From 45b098ad4b55f5e5520a8330aa7613a0a2267a70 Mon Sep 17 00:00:00 2001 From: Jack <113976590+bibblobcode@users.noreply.github.com> Date: Tue, 24 Jan 2023 13:27:44 +0000 Subject: [PATCH] CLDC-1457 Update checkbox validation message (#1207) --- app/models/form/sales/questions/buyers_organisations.rb | 4 ++++ spec/models/form/sales/questions/buyers_organisations_spec.rb | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/app/models/form/sales/questions/buyers_organisations.rb b/app/models/form/sales/questions/buyers_organisations.rb index 6457b6866..735a1563d 100644 --- a/app/models/form/sales/questions/buyers_organisations.rb +++ b/app/models/form/sales/questions/buyers_organisations.rb @@ -15,4 +15,8 @@ class Form::Sales::Questions::BuyersOrganisations < ::Form::Question "pregla" => { "value" => "Local Authority" }, "pregghb" => { "value" => "Help to Buy Agent" }, }.freeze + + def unanswered_error_message + "At least one option must be selected of these four" + end end diff --git a/spec/models/form/sales/questions/buyers_organisations_spec.rb b/spec/models/form/sales/questions/buyers_organisations_spec.rb index 14bb944f4..d9f61df5f 100644 --- a/spec/models/form/sales/questions/buyers_organisations_spec.rb +++ b/spec/models/form/sales/questions/buyers_organisations_spec.rb @@ -35,6 +35,10 @@ RSpec.describe Form::Sales::Questions::BuyersOrganisations, type: :model do expect(question.hint_text).to eq("Select all that apply") end + it "has the correct unanswered_error_message" do + expect(question.unanswered_error_message).to eq("At least one option must be selected of these four") + end + it "has the correct answer_options" do expect(question.answer_options).to eq( {