Browse Source

CLDC-4141: remove redundant inferred CYA vals

pull/3156/head
Nat Dean-Lewis 2 weeks ago
parent
commit
42e80bd98e
  1. 6
      app/models/form/lettings/questions/person_sex_registered_at_birth.rb
  2. 4
      spec/models/form/lettings/questions/lead_tenant_sex_registered_at_birth_spec.rb
  3. 28
      spec/models/form/lettings/questions/person_sex_registered_at_birth_spec.rb

6
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

4
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

28
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

Loading…
Cancel
Save