aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/new_base/render_template_test.rb
diff options
context:
space:
mode:
authorYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-04-29 16:33:24 -0700
committerYehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>2009-05-01 17:31:01 -0700
commit0c3d9bc4c2b329cb754bfed1e465f99d058e1193 (patch)
tree1ef1697cfe82c714549e4367a3ce63e928a4e04e /actionpack/test/new_base/render_template_test.rb
parent4f68311685831b940936130203c240fa23525c84 (diff)
downloadrails-0c3d9bc4c2b329cb754bfed1e465f99d058e1193.tar.gz
rails-0c3d9bc4c2b329cb754bfed1e465f99d058e1193.tar.bz2
rails-0c3d9bc4c2b329cb754bfed1e465f99d058e1193.zip
Ported over render :template tests
Diffstat (limited to 'actionpack/test/new_base/render_template_test.rb')
-rw-r--r--actionpack/test/new_base/render_template_test.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/actionpack/test/new_base/render_template_test.rb b/actionpack/test/new_base/render_template_test.rb
index bc52eb019f..63769df082 100644
--- a/actionpack/test/new_base/render_template_test.rb
+++ b/actionpack/test/new_base/render_template_test.rb
@@ -5,7 +5,8 @@ module RenderTemplate
self.view_paths = [ActionView::Template::FixturePath.new(
"test/basic.html.erb" => "Hello from basic.html.erb",
- "shared.html.erb" => "Elastica"
+ "shared.html.erb" => "Elastica",
+ "locals.html.erb" => "The secret is <%= secret %>"
)]
def index
@@ -19,6 +20,10 @@ module RenderTemplate
def in_top_directory_with_slash
render :template => '/shared'
end
+
+ def with_locals
+ render :template => "locals", :locals => { :secret => 'area51' }
+ end
end
class TestWithoutLayout < SimpleRouteCase
@@ -44,6 +49,14 @@ module RenderTemplate
assert_body "Elastica"
assert_status 200
end
+
+ class TestTemplateRenderWithLocals < SimpleRouteCase
+ describe "rendering a template with local variables"
+
+ get "/render_template/without_layout/with_locals"
+ assert_body "The secret is area51"
+ assert_status 200
+ end
class WithLayoutController < ::ApplicationController