diff --git a/lib/surveyor/helpers/surveyor_helper_methods.rb b/lib/surveyor/helpers/surveyor_helper_methods.rb index e32c75ae..730119ab 100644 --- a/lib/surveyor/helpers/surveyor_helper_methods.rb +++ b/lib/surveyor/helpers/surveyor_helper_methods.rb @@ -61,7 +61,7 @@ def next_question_number(question) # Help_text def render_help_text(obj, context=nil) - obj.render_help_text(context) + obj.render_help_text(context).html_safe end # Answers diff --git a/spec/helpers/surveyor_helper_spec.rb b/spec/helpers/surveyor_helper_spec.rb index ba5f2bd2..9848110b 100644 --- a/spec/helpers/surveyor_helper_spec.rb +++ b/spec/helpers/surveyor_helper_spec.rb @@ -54,6 +54,10 @@ def group g1 = Factory(:question_group, :text => "You are part of the {{group}}", :help_text => "Make sure you know what the {{group}} stands for") helper.render_help_text(g1, FakeMustacheContext).should == "Make sure you know what the NUBIC stands for" end + it "should return html_safe help text" do + g1 = Factory(:question_group, :text => "You are part of the {{group}}", :help_text => "Make sure you know what the {{group}} stands for") + helper.render_help_text(g1, FakeMustacheContext).html_safe?.should be_true + end it "should return rendered text for answer" do q1 = Factory(:question, :text => "Do you work for {{site}}", :answers => [a1 = Factory(:answer, :text => "No, I don't work for {{site}}"), a2 = Factory(:answer, :text => "Yes, I do work for {{site}}") ]) @@ -151,4 +155,4 @@ def rc_to_as(type_sym) end end -end \ No newline at end of file +end