Browse Source

Add hidden_in_check_answers

pull/909/head^2
Kat 4 years ago
parent
commit
0a64b474a9
  1. 11
      app/models/form/sales/questions/nationality1.rb
  2. 10
      spec/models/form/sales/questions/nationality1_spec.rb

11
app/models/form/sales/questions/nationality1.rb

@ -11,13 +11,20 @@ class Form::Sales::Questions::Nationality1 < ::Form::Question
@conditional_for = {
"othernational" => [12],
}
@hidden_in_check_answers = {
"depends_on" => [
{
"national" => 12,
},
],
}
end
ANSWER_OPTIONS = {
"18" => { "value" => "United Kingdom" },
"17" => { "value" => "Republic of Ireland" },
"19" => { "value" => "European Economic Area (EEA), excluding ROI" },
"12" => { "value" => "Other " },
"13" => { "value" => "Buyer prefers not to say " },
"12" => { "value" => "Other" },
"13" => { "value" => "Buyer prefers not to say" },
}.freeze
end

10
spec/models/form/sales/questions/nationality1_spec.rb

@ -50,4 +50,14 @@ RSpec.describe Form::Sales::Questions::Nationality1, type: :model do
"othernational" => [12],
})
end
it "has correct hidden in check answers" do
expect(question.hidden_in_check_answers).to eq({
"depends_on" => [
{
"national" => 12,
},
],
})
end
end

Loading…
Cancel
Save