diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-05-19 16:00:04 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-05-19 16:00:04 +0000 |
commit | aa20834222e829406bf45b133e6413bedf702229 (patch) | |
tree | e3b8cc49aad05a23675f53e892405b3c23dd8ec9 /actionpack/test/controller | |
parent | 68cdcf5ed34b317ae170a3a2b8d479c6e7fe0a5b (diff) | |
download | rails-aa20834222e829406bf45b133e6413bedf702229.tar.gz rails-aa20834222e829406bf45b133e6413bedf702229.tar.bz2 rails-aa20834222e829406bf45b133e6413bedf702229.zip |
Added accessors to logger, params, response, session, and headers from the view, so you can write <% logger.info "stuff" %> instead of <% @logger.info "others" %> -- more consistent with the preferred way of accessing these attributes and collections from the controller
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1307 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/render_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/controller/render_test.rb b/actionpack/test/controller/render_test.rb index fd3e08177a..d3051ef6ad 100644 --- a/actionpack/test/controller/render_test.rb +++ b/actionpack/test/controller/render_test.rb @@ -67,6 +67,10 @@ class TestController < ActionController::Base @customers = [ Customer.new("david"), Customer.new("mary") ] render_text "How's there? #{render_to_string("test/list")}" end + + def accessing_params_in_template + render_template "Hello: <%= params[:name] %>" + end def rescue_action(e) raise end @@ -200,6 +204,12 @@ class RenderTest < Test::Unit::TestCase assert_equal "Living in a nested world", Fun::GamesController.process(@request, @response).body end + def test_accessing_params_in_template + @request.action = "accessing_params_in_template" + @request.query_parameters[:name] = "David" + assert_equal "Hello: David", process_request.body + end + private def process_request TestController.process(@request, @response) |