diff --git a/app/models/form/sales/questions/nationality1.rb b/app/models/form/sales/questions/nationality1.rb index 919230582..737bfc01e 100644 --- a/app/models/form/sales/questions/nationality1.rb +++ b/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 diff --git a/spec/models/form/sales/questions/nationality1_spec.rb b/spec/models/form/sales/questions/nationality1_spec.rb index 118c22f5f..e3d8f832b 100644 --- a/spec/models/form/sales/questions/nationality1_spec.rb +++ b/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