Browse Source

Don't hide person known question in CYA (#2641)

pull/2647/head^2
kosiakkatrina 3 months ago committed by GitHub
parent
commit
8516aa1f23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 7
      app/models/form/sales/questions/person_known.rb
  2. 28
      spec/models/form/sales/questions/person_known_spec.rb

7
app/models/form/sales/questions/person_known.rb

@ -5,13 +5,6 @@ class Form::Sales::Questions::PersonKnown < ::Form::Question
@header = "Do you know the details for person #{person_index}?" @header = "Do you know the details for person #{person_index}?"
@type = "radio" @type = "radio"
@answer_options = ANSWER_OPTIONS @answer_options = ANSWER_OPTIONS
@hidden_in_check_answers = {
"depends_on" => [
{
"details_known_#{person_index}" => 1,
},
],
}
@check_answers_card_number = person_index @check_answers_card_number = person_index
end end

28
spec/models/form/sales/questions/person_known_spec.rb

@ -35,6 +35,10 @@ RSpec.describe Form::Sales::Questions::PersonKnown, type: :model do
expect(question.hint_text).to be_nil expect(question.hint_text).to be_nil
end end
it "has the correct hidden_in_check_answers" do
expect(question.hidden_in_check_answers).to be_nil
end
context "with person 2" do context "with person 2" do
let(:question_id) { "details_known_2" } let(:question_id) { "details_known_2" }
let(:person_index) { 2 } let(:person_index) { 2 }
@ -51,12 +55,6 @@ RSpec.describe Form::Sales::Questions::PersonKnown, type: :model do
expect(question.check_answer_label).to eq("Details known for person 2?") expect(question.check_answer_label).to eq("Details known for person 2?")
end end
it "has the correct hidden_in_check_answers" do
expect(question.hidden_in_check_answers).to eq(
"depends_on" => [{ "details_known_2" => 1 }],
)
end
it "has the correct check_answers_card_number" do it "has the correct check_answers_card_number" do
expect(question.check_answers_card_number).to eq(2) expect(question.check_answers_card_number).to eq(2)
end end
@ -78,12 +76,6 @@ RSpec.describe Form::Sales::Questions::PersonKnown, type: :model do
expect(question.check_answer_label).to eq("Details known for person 3?") expect(question.check_answer_label).to eq("Details known for person 3?")
end end
it "has the correct hidden_in_check_answers" do
expect(question.hidden_in_check_answers).to eq(
"depends_on" => [{ "details_known_3" => 1 }],
)
end
it "has the correct check_answers_card_number" do it "has the correct check_answers_card_number" do
expect(question.check_answers_card_number).to eq(3) expect(question.check_answers_card_number).to eq(3)
end end
@ -105,12 +97,6 @@ RSpec.describe Form::Sales::Questions::PersonKnown, type: :model do
expect(question.check_answer_label).to eq("Details known for person 4?") expect(question.check_answer_label).to eq("Details known for person 4?")
end end
it "has the correct hidden_in_check_answers" do
expect(question.hidden_in_check_answers).to eq(
"depends_on" => [{ "details_known_4" => 1 }],
)
end
it "has the correct check_answers_card_number" do it "has the correct check_answers_card_number" do
expect(question.check_answers_card_number).to eq(4) expect(question.check_answers_card_number).to eq(4)
end end
@ -132,12 +118,6 @@ RSpec.describe Form::Sales::Questions::PersonKnown, type: :model do
expect(question.check_answer_label).to eq("Details known for person 5?") expect(question.check_answer_label).to eq("Details known for person 5?")
end end
it "has the correct hidden_in_check_answers" do
expect(question.hidden_in_check_answers).to eq(
"depends_on" => [{ "details_known_5" => 1 }],
)
end
it "has the correct check_answers_card_number" do it "has the correct check_answers_card_number" do
expect(question.check_answers_card_number).to eq(5) expect(question.check_answers_card_number).to eq(5)
end end

Loading…
Cancel
Save