From 86614e64949937b0e86b4fdea328c13506b4906a Mon Sep 17 00:00:00 2001 From: Rachael Booth Date: Thu, 15 Feb 2024 15:09:55 +0000 Subject: [PATCH] Fix: Ensure declaration doesn't use a separate check answers card in 2024 forms now it's in setup (#2244) --- app/models/form/lettings/questions/declaration.rb | 2 +- spec/models/form/lettings/questions/declaration_spec.rb | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/models/form/lettings/questions/declaration.rb b/app/models/form/lettings/questions/declaration.rb index 4805a9f1e..985c4eed1 100644 --- a/app/models/form/lettings/questions/declaration.rb +++ b/app/models/form/lettings/questions/declaration.rb @@ -5,7 +5,7 @@ class Form::Lettings::Questions::Declaration < ::Form::Question @check_answer_label = "Tenant has seen the privacy notice" @header = "Declaration" @type = "checkbox" - @check_answers_card_number = 0 + @check_answers_card_number = 0 unless form.start_year_after_2024? @top_guidance_partial = form.start_year_after_2024? ? "privacy_notice_tenant_2024" : "privacy_notice_tenant" @question_number = 30 end diff --git a/spec/models/form/lettings/questions/declaration_spec.rb b/spec/models/form/lettings/questions/declaration_spec.rb index 4a22ea453..8230235cf 100644 --- a/spec/models/form/lettings/questions/declaration_spec.rb +++ b/spec/models/form/lettings/questions/declaration_spec.rb @@ -57,6 +57,10 @@ RSpec.describe Form::Lettings::Questions::Declaration, type: :model do it "uses the expected top guidance partial" do expect(question.top_guidance_partial).to eq("privacy_notice_tenant") end + + it "has check_answers_card_number = 0" do + expect(question.check_answers_card_number).to eq(0) + end end context "when the form year is >= 2024" do @@ -73,6 +77,10 @@ RSpec.describe Form::Lettings::Questions::Declaration, type: :model do it "uses the expected top guidance partial" do expect(question.top_guidance_partial).to eq("privacy_notice_tenant_2024") end + + it "has check_answers_card_number nil" do + expect(question.check_answers_card_number).to be_nil + end end it "returns correct unanswered_error_message" do