diff --git a/app/helpers/question_view_helper.rb b/app/helpers/question_view_helper.rb index 5d85b2fa7..8096bd930 100644 --- a/app/helpers/question_view_helper.rb +++ b/app/helpers/question_view_helper.rb @@ -20,6 +20,8 @@ private end def label_tag(page_header, conditional) - page_header.blank? && !conditional ? "h1" : "h2" + return "" if conditional + + page_header.blank? ? "h1" : "h2" end end diff --git a/spec/helpers/question_view_helper_spec.rb b/spec/helpers/question_view_helper_spec.rb index 33341b0e5..1bfb3cb38 100644 --- a/spec/helpers/question_view_helper_spec.rb +++ b/spec/helpers/question_view_helper_spec.rb @@ -69,6 +69,7 @@ RSpec.describe QuestionViewHelper do context "when viewinng a conditional question" do let(:conditional) { true } + let(:tag) { "" } it "returns an options hash with a medium question header" do expect(question_view_helper).to eq(legend_options_hash)