mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Fixed render :template for templates in top level of view path. [#54 state:resolved]
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user