From 0aa32b370f2a922220238fa848afd2c35af88a92 Mon Sep 17 00:00:00 2001 From: Nat Dean-Lewis Date: Fri, 6 Feb 2026 12:16:05 +0000 Subject: [PATCH] CLDC-4177: remove redundant inferred CYA vals --- .../person_sex_registered_at_birth.rb | 6 ------ .../questions/sex_registered_at_birth2.rb | 6 ------ .../person_sex_registered_at_birth_spec.rb | 20 +++++-------------- .../sex_registered_at_birth1_spec.rb | 4 ++++ .../sex_registered_at_birth2_spec.rb | 4 +--- 5 files changed, 10 insertions(+), 30 deletions(-) diff --git a/app/models/form/sales/questions/person_sex_registered_at_birth.rb b/app/models/form/sales/questions/person_sex_registered_at_birth.rb index 86bef9acd..ff61f3ee0 100644 --- a/app/models/form/sales/questions/person_sex_registered_at_birth.rb +++ b/app/models/form/sales/questions/person_sex_registered_at_birth.rb @@ -4,12 +4,6 @@ class Form::Sales::Questions::PersonSexRegisteredAtBirth < ::Form::Question @type = "radio" @copy_key = "sales.household_characteristics.sexrab2.person" if person_index == 2 @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/app/models/form/sales/questions/sex_registered_at_birth2.rb b/app/models/form/sales/questions/sex_registered_at_birth2.rb index 9a26d527a..6f9c77eb4 100644 --- a/app/models/form/sales/questions/sex_registered_at_birth2.rb +++ b/app/models/form/sales/questions/sex_registered_at_birth2.rb @@ -5,12 +5,6 @@ class Form::Sales::Questions::SexRegisteredAtBirth2 < ::Form::Question @type = "radio" @copy_key = "sales.household_characteristics.sexrab2.buyer" @check_answers_card_number = 2 - @inferred_check_answers_value = [{ - "condition" => { - "sexrab2" => "R", - }, - "value" => "Buyer 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/sales/questions/person_sex_registered_at_birth_spec.rb b/spec/models/form/sales/questions/person_sex_registered_at_birth_spec.rb index 2f51fa8c4..eb5f10687 100644 --- a/spec/models/form/sales/questions/person_sex_registered_at_birth_spec.rb +++ b/spec/models/form/sales/questions/person_sex_registered_at_birth_spec.rb @@ -49,9 +49,7 @@ RSpec.describe Form::Sales::Questions::PersonSexRegisteredAtBirth, type: :model 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::Sales::Questions::PersonSexRegisteredAtBirth, type: :model 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::Sales::Questions::PersonSexRegisteredAtBirth, type: :model 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::Sales::Questions::PersonSexRegisteredAtBirth, type: :model 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::Sales::Questions::PersonSexRegisteredAtBirth, type: :model 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 end diff --git a/spec/models/form/sales/questions/sex_registered_at_birth1_spec.rb b/spec/models/form/sales/questions/sex_registered_at_birth1_spec.rb index 0b3661ad6..cc1f981cc 100644 --- a/spec/models/form/sales/questions/sex_registered_at_birth1_spec.rb +++ b/spec/models/form/sales/questions/sex_registered_at_birth1_spec.rb @@ -42,4 +42,8 @@ RSpec.describe Form::Sales::Questions::SexRegisteredAtBirth1, type: :model do 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/sales/questions/sex_registered_at_birth2_spec.rb b/spec/models/form/sales/questions/sex_registered_at_birth2_spec.rb index ed0d0bc61..99ded462a 100644 --- a/spec/models/form/sales/questions/sex_registered_at_birth2_spec.rb +++ b/spec/models/form/sales/questions/sex_registered_at_birth2_spec.rb @@ -44,8 +44,6 @@ RSpec.describe Form::Sales::Questions::SexRegisteredAtBirth2, type: :model do end it "has the correct inferred_check_answers_value" do - expect(question.inferred_check_answers_value).to eq([ - { "condition" => { "sexrab2" => "R" }, "value" => "Buyer prefers not to say" }, - ]) + expect(question.inferred_check_answers_value).to be_nil end end