Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

References #284 - Adds explicit call to html_safe for help text. Added... #406

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/surveyor/helpers/surveyor_helper_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion spec/helpers/surveyor_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}}") ])
Expand Down Expand Up @@ -151,4 +155,4 @@ def rc_to_as(type_sym)
end
end

end
end