diff options
author | Yehuda Katz <wycats@gmail.com> | 2009-03-19 13:35:39 -0700 |
---|---|---|
committer | Yehuda Katz <wycats@gmail.com> | 2009-03-19 13:35:39 -0700 |
commit | 8ab37c76608d7105c47566e79b85fcf72cb11e4b (patch) | |
tree | 590cac61655bdb00d2df7015b515bc125e4c8b10 /actionpack/test/new_base/render_template_test.rb | |
parent | e0447023db7152d3ecdf693bd9aa36c7daa02653 (diff) | |
download | rails-8ab37c76608d7105c47566e79b85fcf72cb11e4b.tar.gz rails-8ab37c76608d7105c47566e79b85fcf72cb11e4b.tar.bz2 rails-8ab37c76608d7105c47566e79b85fcf72cb11e4b.zip |
Started implementing render :action
Diffstat (limited to 'actionpack/test/new_base/render_template_test.rb')
-rw-r--r-- | actionpack/test/new_base/render_template_test.rb | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/actionpack/test/new_base/render_template_test.rb b/actionpack/test/new_base/render_template_test.rb new file mode 100644 index 0000000000..758a206dbb --- /dev/null +++ b/actionpack/test/new_base/render_template_test.rb @@ -0,0 +1,56 @@ +require File.join(File.expand_path(File.dirname(__FILE__)), "test_helper") + +module HappyPath + + class RenderTemplateController < ActionController::Base2 + + def render_hello_world + 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 + + def render_template_in_top_directory_with_slash + render :template => '/shared' + end + end + + class TestTemplateRender < SimpleRouteCase + describe "rendering a normal template with full path" + + get "/happy_path/render_template/render_hello_world" + assert_body "Hello from basic.html.erb" + 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/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" + + get "/happy_path/render_template/render_template_in_top_directory" + assert_body "Elastica" + assert_status 200 + end + + class TestTemplateRenderInTopDirectoryWithSlash < SimpleRouteCase + describe "rendering a template not in a subdirectory with a leading slash" + + get "/happy_path/render_template/render_template_in_top_directory_with_slash" + assert_body "Elastica" + assert_status 200 + end + +end
\ No newline at end of file |