aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorSam Stephenson <sam@37signals.com>2005-10-10 20:35:13 +0000
committerSam Stephenson <sam@37signals.com>2005-10-10 20:35:13 +0000
commit0886bb391d97ec96d3028d5cac93ce2f7f8467e6 (patch)
tree9eb71c40c2f609d71be7032f636d4b11b8bd882a /actionpack/test
parente3655ef733f7f69a4b1175cd6843f8bfe4c32f5d (diff)
downloadrails-0886bb391d97ec96d3028d5cac93ce2f7f8467e6.tar.gz
rails-0886bb391d97ec96d3028d5cac93ce2f7f8467e6.tar.bz2
rails-0886bb391d97ec96d3028d5cac93ce2f7f8467e6.zip
Fixed that an instance variable with the same name as a partial should be implicitly passed as the partial :object. Closes #2269.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2522 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/new_render_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb
index a1af0a0091..24c3a0e765 100644
--- a/actionpack/test/controller/new_render_test.rb
+++ b/actionpack/test/controller/new_render_test.rb
@@ -106,6 +106,11 @@ class NewRenderTestController < ActionController::Base
render :partial => "hash_object", :object => {:first_name => "Sam"}
end
+ def partial_with_implicit_local_assignment
+ @customer = Customer.new("Marcel")
+ render :partial => "customer"
+ end
+
def hello_in_a_string
@customers = [ Customer.new("david"), Customer.new("mary") ]
render :text => "How's there? #{render_to_string("test/list")}"
@@ -380,6 +385,11 @@ class NewRenderTest < Test::Unit::TestCase
assert_equal "Sam", @response.body
end
+ def test_partial_with_implicit_local_assignment
+ get :partial_with_implicit_local_assignment
+ assert_equal "Hello: Marcel", @response.body
+ end
+
def test_render_text_with_assigns
get :render_text_with_assigns
assert_equal "world", assigns["hello"]