From 42e80bd98e5760e95a274a92709447ece95c716e Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis Date: Fri, 6 Feb 2026 12:17:54 +0000 Subject: [PATCH] CLDC-4141: remove redundant inferred CYA vals --- .../person_sex_registered_at_birth.rb | 6 ---- ...ead_tenant_sex_registered_at_birth_spec.rb | 4 +++ .../person_sex_registered_at_birth_spec.rb | 28 +++++-------------- 3 files changed, 11 insertions(+), 27 deletions(-) diff --git a/app/models/form/lettings/questions/person_sex_registered_at_birth.rb b/app/models/form/lettings/questions/person_sex_registered_at_birth.rb index 6ea48e8e5..514e9b2b5 100644 --- a/app/models/form/lettings/questions/person_sex_registered_at_birth.rb +++ b/app/models/form/lettings/questions/person_sex_registered_at_birth.rb @@ -3,12 +3,6 @@ class Form::Lettings::Questions::PersonSexRegisteredAtBirth < ::Form::Question super(id, hsh, page) @type = "radio" @check_answers_card_number = person_index - @inferred_check_answers_value = [{ - "condition" => { - id => "R", - }, - "value" => "Person prefers not to say", - }] @answer_options = ANSWER_OPTIONS @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] end diff --git a/spec/models/form/lettings/questions/lead_tenant_sex_registered_at_birth_spec.rb b/spec/models/form/lettings/questions/lead_tenant_sex_registered_at_birth_spec.rb index 2707b0246..b8064328e 100644 --- a/spec/models/form/lettings/questions/lead_tenant_sex_registered_at_birth_spec.rb +++ b/spec/models/form/lettings/questions/lead_tenant_sex_registered_at_birth_spec.rb @@ -42,4 +42,8 @@ RSpec.describe Form::Lettings::Questions::LeadTenantSexRegisteredAtBirth, type: it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end + + it "has the correct inferred_check_answers_value" do + expect(question.inferred_check_answers_value).to be_nil + end end diff --git a/spec/models/form/lettings/questions/person_sex_registered_at_birth_spec.rb b/spec/models/form/lettings/questions/person_sex_registered_at_birth_spec.rb index 7bf47da65..8aa868c6f 100644 --- a/spec/models/form/lettings/questions/person_sex_registered_at_birth_spec.rb +++ b/spec/models/form/lettings/questions/person_sex_registered_at_birth_spec.rb @@ -49,9 +49,7 @@ RSpec.describe Form::Lettings::Questions::PersonSexRegisteredAtBirth, type: :mod end it "has the correct inferred_check_answers_value" do - expect(question.inferred_check_answers_value).to eq([ - { "condition" => { "sexrab2" => "R" }, "value" => "Person prefers not to say" }, - ]) + expect(question.inferred_check_answers_value).to be_nil end end @@ -68,9 +66,7 @@ RSpec.describe Form::Lettings::Questions::PersonSexRegisteredAtBirth, type: :mod end it "has the correct inferred_check_answers_value" do - expect(question.inferred_check_answers_value).to eq([ - { "condition" => { "sexrab3" => "R" }, "value" => "Person prefers not to say" }, - ]) + expect(question.inferred_check_answers_value).to be_nil end end @@ -87,9 +83,7 @@ RSpec.describe Form::Lettings::Questions::PersonSexRegisteredAtBirth, type: :mod end it "has the correct inferred_check_answers_value" do - expect(question.inferred_check_answers_value).to eq([ - { "condition" => { "sexrab4" => "R" }, "value" => "Person prefers not to say" }, - ]) + expect(question.inferred_check_answers_value).to be_nil end end @@ -106,9 +100,7 @@ RSpec.describe Form::Lettings::Questions::PersonSexRegisteredAtBirth, type: :mod end it "has the correct inferred_check_answers_value" do - expect(question.inferred_check_answers_value).to eq([ - { "condition" => { "sexrab5" => "R" }, "value" => "Person prefers not to say" }, - ]) + expect(question.inferred_check_answers_value).to be_nil end end @@ -125,9 +117,7 @@ RSpec.describe Form::Lettings::Questions::PersonSexRegisteredAtBirth, type: :mod end it "has the correct inferred_check_answers_value" do - expect(question.inferred_check_answers_value).to eq([ - { "condition" => { "sexrab6" => "R" }, "value" => "Person prefers not to say" }, - ]) + expect(question.inferred_check_answers_value).to be_nil end end @@ -144,9 +134,7 @@ RSpec.describe Form::Lettings::Questions::PersonSexRegisteredAtBirth, type: :mod end it "has the correct inferred_check_answers_value" do - expect(question.inferred_check_answers_value).to eq([ - { "condition" => { "sexrab7" => "R" }, "value" => "Person prefers not to say" }, - ]) + expect(question.inferred_check_answers_value).to be_nil end end @@ -163,9 +151,7 @@ RSpec.describe Form::Lettings::Questions::PersonSexRegisteredAtBirth, type: :mod end it "has the correct inferred_check_answers_value" do - expect(question.inferred_check_answers_value).to eq([ - { "condition" => { "sexrab8" => "R" }, "value" => "Person prefers not to say" }, - ]) + expect(question.inferred_check_answers_value).to be_nil end end end