From b40a8b94ef4862f78727702935255741165cac41 Mon Sep 17 00:00:00 2001 From: Samuel Young Date: Mon, 23 Feb 2026 09:49:34 +0000 Subject: [PATCH] CLDC-4142: Add CYA override for gender_same_as_sex (#3185) it's clearer for 'No' here as the below question in CYA talks above gender identity description --- .../lettings/questions/gender_same_as_sex.rb | 1 + .../questions/gender_same_as_sex_spec.rb | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/models/form/lettings/questions/gender_same_as_sex.rb b/app/models/form/lettings/questions/gender_same_as_sex.rb index 1fdfddda5..0b0fd55b5 100644 --- a/app/models/form/lettings/questions/gender_same_as_sex.rb +++ b/app/models/form/lettings/questions/gender_same_as_sex.rb @@ -7,6 +7,7 @@ class Form::Lettings::Questions::GenderSameAsSex < ::Form::Question @conditional_for = { "gender_description#{person_index}" => [2] } @person_index = person_index @question_number = question_number + @inferred_check_answers_value = [{ "condition" => { "gender_same_as_sex#{person_index}" => 2 }, "value" => "No" }] end def answer_options diff --git a/spec/models/form/lettings/questions/gender_same_as_sex_spec.rb b/spec/models/form/lettings/questions/gender_same_as_sex_spec.rb index 65734d9ef..09a9ef19f 100644 --- a/spec/models/form/lettings/questions/gender_same_as_sex_spec.rb +++ b/spec/models/form/lettings/questions/gender_same_as_sex_spec.rb @@ -42,7 +42,7 @@ RSpec.describe Form::Lettings::Questions::GenderSameAsSex, type: :model do end it "has the correct inferred_check_answers_value" do - expect(question.inferred_check_answers_value).to be_nil + expect(question.inferred_check_answers_value).to eq([{ "condition" => { "gender_same_as_sex#{person_index}" => 2 }, "value" => "No" }]) end it "has the correct question number" do @@ -72,7 +72,7 @@ RSpec.describe Form::Lettings::Questions::GenderSameAsSex, type: :model do end it "has the correct inferred_check_answers_value" do - expect(question.inferred_check_answers_value).to be_nil + expect(question.inferred_check_answers_value).to eq([{ "condition" => { "gender_same_as_sex#{person_index}" => 2 }, "value" => "No" }]) end it "has the correct question number" do @@ -102,7 +102,7 @@ RSpec.describe Form::Lettings::Questions::GenderSameAsSex, type: :model do end it "has the correct inferred_check_answers_value" do - expect(question.inferred_check_answers_value).to be_nil + expect(question.inferred_check_answers_value).to eq([{ "condition" => { "gender_same_as_sex#{person_index}" => 2 }, "value" => "No" }]) end it "has the correct question number" do @@ -132,7 +132,7 @@ RSpec.describe Form::Lettings::Questions::GenderSameAsSex, type: :model do end it "has the correct inferred_check_answers_value" do - expect(question.inferred_check_answers_value).to be_nil + expect(question.inferred_check_answers_value).to eq([{ "condition" => { "gender_same_as_sex#{person_index}" => 2 }, "value" => "No" }]) end it "has the correct question number" do @@ -162,7 +162,7 @@ RSpec.describe Form::Lettings::Questions::GenderSameAsSex, type: :model do end it "has the correct inferred_check_answers_value" do - expect(question.inferred_check_answers_value).to be_nil + expect(question.inferred_check_answers_value).to eq([{ "condition" => { "gender_same_as_sex#{person_index}" => 2 }, "value" => "No" }]) end it "has the correct question number" do @@ -192,7 +192,7 @@ RSpec.describe Form::Lettings::Questions::GenderSameAsSex, type: :model do end it "has the correct inferred_check_answers_value" do - expect(question.inferred_check_answers_value).to be_nil + expect(question.inferred_check_answers_value).to eq([{ "condition" => { "gender_same_as_sex#{person_index}" => 2 }, "value" => "No" }]) end it "has the correct question number" do @@ -222,7 +222,7 @@ RSpec.describe Form::Lettings::Questions::GenderSameAsSex, type: :model do end it "has the correct inferred_check_answers_value" do - expect(question.inferred_check_answers_value).to be_nil + expect(question.inferred_check_answers_value).to eq([{ "condition" => { "gender_same_as_sex#{person_index}" => 2 }, "value" => "No" }]) end it "has the correct question number" do @@ -252,7 +252,7 @@ RSpec.describe Form::Lettings::Questions::GenderSameAsSex, type: :model do end it "has the correct inferred_check_answers_value" do - expect(question.inferred_check_answers_value).to be_nil + expect(question.inferred_check_answers_value).to eq([{ "condition" => { "gender_same_as_sex#{person_index}" => 2 }, "value" => "No" }]) end it "has the correct question number" do