diff options
author | Yehuda Katz <wycats@gmail.com> | 2009-03-19 15:45:48 -0700 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-03-19 15:45:48 -0700 |
commit | 890321e51e0c51f61f9198d247727e98f7485899 (patch) | |
tree | 19457c8d5e9bff3d3b3b16fc4861964e5297957c /actionpack/test/new_base/render_action_test.rb | |
parent | 8ab37c76608d7105c47566e79b85fcf72cb11e4b (diff) | |
download | rails-890321e51e0c51f61f9198d247727e98f7485899.tar.gz rails-890321e51e0c51f61f9198d247727e98f7485899.tar.bz2 rails-890321e51e0c51f61f9198d247727e98f7485899.zip |
Get very basic layouts working.
* Required small architecture change
Diffstat (limited to 'actionpack/test/new_base/render_action_test.rb')
-rw-r--r-- | actionpack/test/new_base/render_action_test.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/actionpack/test/new_base/render_action_test.rb b/actionpack/test/new_base/render_action_test.rb index b6e98f82aa..99482cd4a1 100644 --- a/actionpack/test/new_base/render_action_test.rb +++ b/actionpack/test/new_base/render_action_test.rb @@ -2,6 +2,7 @@ require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper") module HappyPath + # This has no layout and it works class RenderActionController < ActionController::Base2 def render_action_hello_world @@ -71,5 +72,27 @@ module HappyPath assert_body "Hello world!" assert_status 200 end + + # # ==== Render actions with layouts ==== + + class RenderActionWithLayoutController < ActionController::Base2 + # Set the view path to an application view structure with layouts + self.view_paths = [File.join(File.dirname(__FILE__), 'views', 'with_layout')] + + def hello_world + render :action => "hello_world" + end + end + + class TestRenderActionWithLayout < SimpleRouteCase + describe %( + Render hello_world and implicitly use application.html.erb as a layout if + no layout is specified and no controller layout is present + ) + + get "/happy_path/render_action_with_layout/hello_world" + assert_body "OHAI Hello World! KTHXBAI" + assert_status 200 + end end
\ No newline at end of file |