diff options
author | José Valim <jose.valim@gmail.com> | 2011-04-16 01:09:05 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-04-16 01:10:13 +0200 |
commit | fad214b9e1c0a66f8fecde48fbd8d122e5c51e33 (patch) | |
tree | 3ca51e274e0992c460e28c81f501398757669899 /actionpack/test/template | |
parent | c630750fa59e248fb5af96f850392333e341ccd7 (diff) | |
download | rails-fad214b9e1c0a66f8fecde48fbd8d122e5c51e33.tar.gz rails-fad214b9e1c0a66f8fecde48fbd8d122e5c51e33.tar.bz2 rails-fad214b9e1c0a66f8fecde48fbd8d122e5c51e33.zip |
Initial work on fibered layout.
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/capture_helper_test.rb | 2 | ||||
-rw-r--r-- | actionpack/test/template/fibered_render_test.rb | 27 |
2 files changed, 28 insertions, 1 deletions
diff --git a/actionpack/test/template/capture_helper_test.rb b/actionpack/test/template/capture_helper_test.rb index 03050485fa..ec252fa117 100644 --- a/actionpack/test/template/capture_helper_test.rb +++ b/actionpack/test/template/capture_helper_test.rb @@ -4,7 +4,7 @@ class CaptureHelperTest < ActionView::TestCase def setup super @av = ActionView::Base.new - @_content_for = Hash.new {|h,k| h[k] = "" } + @_view_flow = ActionView::Flow.new end def test_capture_captures_the_temporary_output_buffer_in_its_block diff --git a/actionpack/test/template/fibered_render_test.rb b/actionpack/test/template/fibered_render_test.rb new file mode 100644 index 0000000000..f62af10812 --- /dev/null +++ b/actionpack/test/template/fibered_render_test.rb @@ -0,0 +1,27 @@ +# encoding: utf-8 +require 'abstract_unit' +require 'controller/fake_models' + +class TestController < ActionController::Base +end + + +class FiberedTest < ActiveSupport::TestCase + + def setup + view_paths = ActionController::Base.view_paths + @assigns = { :secret => 'in the sauce' } + @view = ActionView::Base.new(view_paths, @assigns) + @view.magic_medicine = true + @controller_view = TestController.new.view_context + end + + def test_render_template + assert_equal "Hello world!", @view.render(:template => "test/hello_world") + end + + def test_render_with_layout + assert_equal %(<title></title>\nHello world!\n), + @view.render(:template => "test/hello_world.erb", :layout => "layouts/yield") + end +end if defined?(Fiber)
\ No newline at end of file |