diff options
author | José Valim <jose.valim@gmail.com> | 2011-04-16 10:50:33 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-04-16 10:50:33 +0200 |
commit | 29078ff8f1561420a405384772c051dc30bdcbf6 (patch) | |
tree | 50858283c5dc58d2060ae9340e33b02b1a4e69fa /actionpack/test/template/capture_helper_test.rb | |
parent | 62668cccb9a288b0cd6f6dd49df71661164be2c4 (diff) | |
download | rails-29078ff8f1561420a405384772c051dc30bdcbf6.tar.gz rails-29078ff8f1561420a405384772c051dc30bdcbf6.tar.bz2 rails-29078ff8f1561420a405384772c051dc30bdcbf6.zip |
Basic tests for streaming. Basic tests for provide.
Diffstat (limited to 'actionpack/test/template/capture_helper_test.rb')
-rw-r--r-- | actionpack/test/template/capture_helper_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/test/template/capture_helper_test.rb b/actionpack/test/template/capture_helper_test.rb index 3ebcb8165f..c2f0825375 100644 --- a/actionpack/test/template/capture_helper_test.rb +++ b/actionpack/test/template/capture_helper_test.rb @@ -45,6 +45,17 @@ class CaptureHelperTest < ActionView::TestCase assert ! content_for?(:something_else) end + def test_provide + assert !content_for?(:title) + provide :title, "title" + assert content_for?(:title) + assert_equal "title", @_view_flow.get(:title) + provide :title, "<p>title</p>" + assert_equal "<p>title</p>", @_view_flow.get(:title) + provide :title, "<p>title</p>".html_safe + assert_equal "<p>title</p>", @_view_flow.get(:title) + end + def test_with_output_buffer_swaps_the_output_buffer_given_no_argument assert_nil @av.output_buffer buffer = @av.with_output_buffer do |