From a156562762e795c2e5382570c1fc30c11cfa9a24 Mon Sep 17 00:00:00 2001 From: Mario Visic Date: Wed, 4 Dec 2013 13:50:17 +1100 Subject: [PATCH] Fix issue where TextHelper#simple_format was calling missing 'raw' method --- actionview/lib/action_view/helpers/text_helper.rb | 2 ++ actionview/test/template/text_helper_test.rb | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/actionview/lib/action_view/helpers/text_helper.rb b/actionview/lib/action_view/helpers/text_helper.rb index e75c6cabc9..3478eadbf2 100644 --- a/actionview/lib/action_view/helpers/text_helper.rb +++ b/actionview/lib/action_view/helpers/text_helper.rb @@ -31,6 +31,8 @@ module TextHelper include SanitizeHelper include TagHelper + include OutputSafetyHelper + # The preferred method of outputting text in your views is to use the # <%= "text" %> eRuby syntax. The regular _puts_ and _print_ methods # do not operate as expected in an eRuby code block. If you absolutely must diff --git a/actionview/test/template/text_helper_test.rb b/actionview/test/template/text_helper_test.rb index dd1a92acfb..5b3bccf951 100644 --- a/actionview/test/template/text_helper_test.rb +++ b/actionview/test/template/text_helper_test.rb @@ -21,6 +21,11 @@ def test_simple_format_should_be_html_safe assert simple_format(" test with html tags ").html_safe? end + def test_simple_format_included_in_isolation + helper_klass = Class.new { include ActionView::Helpers::TextHelper } + assert helper_klass.new.simple_format(" test with html tags ").html_safe? + end + def test_simple_format assert_equal "

", simple_format(nil)