Browse Source

CLDC-4177: remove redundant inferred CYA vals

pull/3156/head
Nat Dean-Lewis 2 weeks ago
parent
commit
0aa32b370f
  1. 6
      app/models/form/sales/questions/person_sex_registered_at_birth.rb
  2. 6
      app/models/form/sales/questions/sex_registered_at_birth2.rb
  3. 20
      spec/models/form/sales/questions/person_sex_registered_at_birth_spec.rb
  4. 4
      spec/models/form/sales/questions/sex_registered_at_birth1_spec.rb
  5. 4
      spec/models/form/sales/questions/sex_registered_at_birth2_spec.rb

6
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

6
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

20
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

4
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

4
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

Loading…
Cancel
Save