aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2016-01-16 04:23:27 -0200
committerRafael Mendonça França <rafaelmfranca@gmail.com>2016-01-16 04:23:27 -0200
commitf5065ef60c011a0d84224e74e1e8a0b882c36223 (patch)
tree5632a7405e3e8f061d7ab9e3f0d1e7083d3aadd3 /actionview/test
parentde2259791cd21e80d44ec7c7562324c73ff85699 (diff)
parent7c988f8030fa5b779041d682c12132ab4da47d1e (diff)
downloadrails-f5065ef60c011a0d84224e74e1e8a0b882c36223.tar.gz
rails-f5065ef60c011a0d84224e74e1e8a0b882c36223.tar.bz2
rails-f5065ef60c011a0d84224e74e1e8a0b882c36223.zip
Merge pull request #20046 from yoongkang/ladida
Use ActiveSupport::SafeBuffer when flushing content_for
Diffstat (limited to 'actionview/test')
-rw-r--r--actionview/test/template/capture_helper_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/actionview/test/template/capture_helper_test.rb b/actionview/test/template/capture_helper_test.rb
index 1e099d482c..7e6761e580 100644
--- a/actionview/test/template/capture_helper_test.rb
+++ b/actionview/test/template/capture_helper_test.rb
@@ -148,6 +148,19 @@ class CaptureHelperTest < ActionView::TestCase
assert ! content_for?(:something_else)
end
+ def test_content_for_should_be_html_safe_after_flush_empty
+ assert ! content_for?(:title)
+ content_for :title do
+ content_tag(:p, 'title')
+ end
+ assert content_for(:title).html_safe?
+ content_for :title, "", flush: true
+ content_for(:title) do
+ content_tag(:p, 'title')
+ end
+ assert content_for(:title).html_safe?
+ end
+
def test_provide
assert !content_for?(:title)
provide :title, "hi"