diff options
author | José Valim <jose.valim@gmail.com> | 2011-04-16 11:34:07 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-04-16 11:34:07 +0200 |
commit | ab105e6072d291d7024e4e645defa5eff31f6f21 (patch) | |
tree | ceb36f53f3f7ac692f0fa075e72ab683566220f1 /actionpack/test/template | |
parent | 3e0aedba909562411b8f369115828a79a7a77a0a (diff) | |
download | rails-ab105e6072d291d7024e4e645defa5eff31f6f21.tar.gz rails-ab105e6072d291d7024e4e645defa5eff31f6f21.tar.bz2 rails-ab105e6072d291d7024e4e645defa5eff31f6f21.zip |
content_for should work with provide.
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/capture_helper_test.rb | 11 | ||||
-rw-r--r-- | actionpack/test/template/streaming_render_test.rb | 12 |
2 files changed, 17 insertions, 6 deletions
diff --git a/actionpack/test/template/capture_helper_test.rb b/actionpack/test/template/capture_helper_test.rb index c2f0825375..a9a36e6e6b 100644 --- a/actionpack/test/template/capture_helper_test.rb +++ b/actionpack/test/template/capture_helper_test.rb @@ -47,13 +47,16 @@ class CaptureHelperTest < ActionView::TestCase def test_provide assert !content_for?(:title) - provide :title, "title" + provide :title, "hi" assert content_for?(:title) - assert_equal "title", @_view_flow.get(:title) + assert_equal "hi", @_view_flow.get(:title) provide :title, "<p>title</p>" - assert_equal "<p>title</p>", @_view_flow.get(:title) + assert_equal "hi<p>title</p>", @_view_flow.get(:title) + + @_view_flow = ActionView::OutputFlow.new + provide :title, "hi" provide :title, "<p>title</p>".html_safe - assert_equal "<p>title</p>", @_view_flow.get(:title) + assert_equal "hi<p>title</p>", @_view_flow.get(:title) end def test_with_output_buffer_swaps_the_output_buffer_given_no_argument diff --git a/actionpack/test/template/streaming_render_test.rb b/actionpack/test/template/streaming_render_test.rb index 754ede9701..4d69081570 100644 --- a/actionpack/test/template/streaming_render_test.rb +++ b/actionpack/test/template/streaming_render_test.rb @@ -88,10 +88,18 @@ class FiberedTest < ActiveSupport::TestCase end def test_render_with_streaming_multiple_yields_provide_and_content_for - assert_equal "Yes, \nthis works\n like a charm.", buffered_render(:template => "test/streaming", :layout => "layouts/streaming") + assert_equal "Yes, \nthis works\n like a charm.", + buffered_render(:template => "test/streaming", :layout => "layouts/streaming") end def test_render_with_streaming_with_fake_yields_and_streaming_buster - assert_equal "This won't look\n good.", buffered_render(:template => "test/streaming_buster", :layout => "layouts/streaming") + assert_equal "This won't look\n good.", + buffered_render(:template => "test/streaming_buster", :layout => "layouts/streaming") end + + def test_render_with_nested_streaming_multiple_yields_provide_and_content_for + assert_equal "?Yes, \n\nthis works\n\n? like a charm.", + buffered_render(:template => "test/nested_streaming", :layout => "layouts/streaming") + end + end if defined?(Fiber)
\ No newline at end of file |