Browse Source

Fix: Ensure declaration doesn't use a separate check answers card in 2024 forms now it's in setup (#2244)

pull/2183/head
Rachael Booth 10 months ago committed by GitHub
parent
commit
86614e6494
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      app/models/form/lettings/questions/declaration.rb
  2. 8
      spec/models/form/lettings/questions/declaration_spec.rb

2
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" @check_answer_label = "Tenant has seen the privacy notice"
@header = "Declaration" @header = "Declaration"
@type = "checkbox" @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" @top_guidance_partial = form.start_year_after_2024? ? "privacy_notice_tenant_2024" : "privacy_notice_tenant"
@question_number = 30 @question_number = 30
end end

8
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 it "uses the expected top guidance partial" do
expect(question.top_guidance_partial).to eq("privacy_notice_tenant") expect(question.top_guidance_partial).to eq("privacy_notice_tenant")
end end
it "has check_answers_card_number = 0" do
expect(question.check_answers_card_number).to eq(0)
end
end end
context "when the form year is >= 2024" do 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 it "uses the expected top guidance partial" do
expect(question.top_guidance_partial).to eq("privacy_notice_tenant_2024") expect(question.top_guidance_partial).to eq("privacy_notice_tenant_2024")
end end
it "has check_answers_card_number nil" do
expect(question.check_answers_card_number).to be_nil
end
end end
it "returns correct unanswered_error_message" do it "returns correct unanswered_error_message" do

Loading…
Cancel
Save