Browse Source

feat: add hidden_in_check_answers (#1325)

pull/1296/head^2
natdeanlewissoftwire 2 years ago committed by GitHub
parent
commit
609c9ba91e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      app/models/form/sales/questions/previous_postcode_known.rb
  2. 9
      spec/models/form/sales/questions/previous_postcode_known_spec.rb

10
app/models/form/sales/questions/previous_postcode_known.rb

@ -10,6 +10,16 @@ class Form::Sales::Questions::PreviousPostcodeKnown < ::Form::Question
"ppostcode_full" => [0], "ppostcode_full" => [0],
} }
@hint_text = "This is also known as the household’s 'last settled home'" @hint_text = "This is also known as the household’s 'last settled home'"
@hidden_in_check_answers = {
"depends_on" => [
{
"ppcodenk" => 0,
},
{
"ppcodenk" => 1,
},
],
}
end end
ANSWER_OPTIONS = { ANSWER_OPTIONS = {

9
spec/models/form/sales/questions/previous_postcode_known_spec.rb

@ -47,4 +47,13 @@ RSpec.describe Form::Sales::Questions::PreviousPostcodeKnown, type: :model do
it "has the correct hint" do it "has the correct hint" do
expect(question.hint_text).to eq("This is also known as the household’s 'last settled home'") expect(question.hint_text).to eq("This is also known as the household’s 'last settled home'")
end end
it "has the correct hidden_in_check_answers" do
expect(question.hidden_in_check_answers).to eq({
"depends_on" => [
{ "ppcodenk" => 0 },
{ "ppcodenk" => 1 },
],
})
end
end end

Loading…
Cancel
Save