aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/fibered_render_test.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-04-16 01:09:05 +0200
committerJosé Valim <jose.valim@gmail.com>2011-04-16 01:10:13 +0200
commitfad214b9e1c0a66f8fecde48fbd8d122e5c51e33 (patch)
tree3ca51e274e0992c460e28c81f501398757669899 /actionpack/test/template/fibered_render_test.rb
parentc630750fa59e248fb5af96f850392333e341ccd7 (diff)
downloadrails-fad214b9e1c0a66f8fecde48fbd8d122e5c51e33.tar.gz
rails-fad214b9e1c0a66f8fecde48fbd8d122e5c51e33.tar.bz2
rails-fad214b9e1c0a66f8fecde48fbd8d122e5c51e33.zip
Initial work on fibered layout.
Diffstat (limited to 'actionpack/test/template/fibered_render_test.rb')
-rw-r--r--actionpack/test/template/fibered_render_test.rb27
1 files changed, 27 insertions, 0 deletions
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