Fixed render :template for templates in top level of view path. [#54 state:resolved]

This commit is contained in:
Pratik Naik
2008-05-01 10:21:46 +01:00
parent 6f20efdaf7
commit 74436d2203
4 changed files with 30 additions and 3 deletions

View File

@@ -23,6 +23,14 @@ class TestController < ActionController::Base
def render_hello_world_with_forward_slash
render :template => "/test/hello_world"
end
def render_template_in_top_directory
render :template => 'shared'
end
def render_template_in_top_directory_with_slash
render :template => '/shared'
end
def render_hello_world_from_variable
@person = "david"
@@ -243,6 +251,18 @@ class RenderTest < Test::Unit::TestCase
get :render_hello_world_with_forward_slash
assert_template "test/hello_world"
end
def test_render_in_top_directory
get :render_template_in_top_directory
assert_template "shared"
assert_equal "Elastica", @response.body
end
def test_render_in_top_directory_with_slash
get :render_template_in_top_directory_with_slash
assert_template "shared"
assert_equal "Elastica", @response.body
end
def test_render_from_variable
get :render_hello_world_from_variable