diff options
Diffstat (limited to 'actionpack/test/new_base/render_action_test.rb')
-rw-r--r-- | actionpack/test/new_base/render_action_test.rb | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/actionpack/test/new_base/render_action_test.rb b/actionpack/test/new_base/render_action_test.rb index 99482cd4a1..188fb44265 100644 --- a/actionpack/test/new_base/render_action_test.rb +++ b/actionpack/test/new_base/render_action_test.rb @@ -77,7 +77,23 @@ module HappyPath 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')] + self.view_paths = [File.join(File.dirname(__FILE__), 'views', 'with_application_layout')] + + def hello_world + render :action => "hello_world" + end + end + + class RenderActionWithControllerLayoutController < ActionController::Base2 + self.view_paths = [File.join(File.dirname(__FILE__), 'views', 'with_controller_layout')] + + def hello_world + render :action => "hello_world" + end + end + + class RenderActionWithControllerLayoutFirstController < ActionController::Base2 + self.view_paths = [File.join(File.dirname(__FILE__), 'views', 'with_both_layouts')] def hello_world render :action => "hello_world" @@ -94,5 +110,22 @@ module HappyPath assert_body "OHAI Hello World! KTHXBAI" assert_status 200 end - + + class TestRenderActionWithControllerLayout < SimpleRouteCase + describe "Render hello_world and implicitly use <controller_path>.html.erb as a layout." + + get "/happy_path/render_action_with_controller_layout/hello_world" + assert_body "With Controller Layout! Hello World! KTHXBAI" + assert_status 200 + end + + class TestRenderActionWithControllerLayoutFirst < SimpleRouteCase + describe "Render hello_world and implicitly use <controller_path>.html.erb over application.html.erb as a layout" + + get "/happy_path/render_action_with_controller_layout_first/hello_world" + assert_body "With Controller Layout! Hello World! KTHXBAI" + assert_status 200 + end + + # TODO: Implement a FixtureViewPath end
\ No newline at end of file |