diff options
Diffstat (limited to 'actionpack/test/new_base/render_template_test.rb')
-rw-r--r-- | actionpack/test/new_base/render_template_test.rb | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/actionpack/test/new_base/render_template_test.rb b/actionpack/test/new_base/render_template_test.rb index c6c0269b40..fd0519159e 100644 --- a/actionpack/test/new_base/render_template_test.rb +++ b/actionpack/test/new_base/render_template_test.rb @@ -4,7 +4,7 @@ module HappyPath class RenderTemplateWithoutLayoutController < ActionController::Base2 - self.view_paths = [ActionView::FixtureTemplate::FixturePath.new( + self.view_paths = [ActionView::Template::FixturePath.new( "test/basic.html.erb" => "Hello from basic.html.erb", "shared.html.erb" => "Elastica" )] @@ -13,10 +13,6 @@ module HappyPath render :template => "test/basic" end - def render_hello_world_with_forward_slash - render :template => "/test/basic" - end - def render_template_in_top_directory render :template => 'shared' end @@ -34,14 +30,6 @@ module HappyPath assert_status 200 end - class TestTemplateRenderWithForwardSlash < SimpleRouteCase - describe "rendering a normal template with full path starting with a leading slash" - - get "/happy_path/render_template_without_layout/render_hello_world_with_forward_slash" - assert_body "Hello from basic.html.erb" - assert_status 200 - end - class TestTemplateRenderInTopDirectory < SimpleRouteCase describe "rendering a template not in a subdirectory" @@ -60,7 +48,7 @@ module HappyPath class RenderTemplateWithLayoutController < ::ApplicationController - self.view_paths = [ActionView::FixtureTemplate::FixturePath.new( + self.view_paths = [ActionView::Template::FixturePath.new( "test/basic.html.erb" => "Hello from basic.html.erb", "shared.html.erb" => "Elastica", "layouts/application.html.erb" => "<%= yield %>, I'm here!", @@ -127,7 +115,26 @@ module HappyPath assert_body "Hello from basic.html.erb, I wish thee well." assert_status 200 end - - +end + +module Compatibility + class RenderTemplateWithoutLayoutController < ActionController::CompatibleBase2 + self.view_paths = [ActionView::Template::FixturePath.new( + "test/basic.html.erb" => "Hello from basic.html.erb", + "shared.html.erb" => "Elastica" + )] + + def render_hello_world_with_forward_slash + render :template => "/test/basic" + end + end + + class TestTemplateRenderWithForwardSlash < SimpleRouteCase + describe "rendering a normal template with full path starting with a leading slash" + + get "/compatibility/render_template_without_layout/render_hello_world_with_forward_slash" + assert_body "Hello from basic.html.erb" + assert_status 200 + end end
\ No newline at end of file |