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}?"
@type = "radio"
@answer_options = ANSWER_OPTIONS
@hidden_in_check_answers = {
"depends_on" => [
{
"details_known_#{person_index}" => 1,
},
],
}
@check_answers_card_number = person_index
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
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
let(:question_id) { "details_known_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?")
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
expect(question.check_answers_card_number).to eq(2)
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?")
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
expect(question.check_answers_card_number).to eq(3)
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?")
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
expect(question.check_answers_card_number).to eq(4)
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?")
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
expect(question.check_answers_card_number).to eq(5)
end

Loading…
Cancel
Save