diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-09-09 07:27:44 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-09-09 07:27:44 +0000 |
commit | e3c02d8c66ae3df7a58ba7d76dfc464f26dcff67 (patch) | |
tree | bb21f2713880c9f8841094e2fcf270fb5c69596d /actionpack/test | |
parent | 46110aa689412816d077b1f248a6cdb4d9552eda (diff) | |
download | rails-e3c02d8c66ae3df7a58ba7d76dfc464f26dcff67.tar.gz rails-e3c02d8c66ae3df7a58ba7d76dfc464f26dcff67.tar.bz2 rails-e3c02d8c66ae3df7a58ba7d76dfc464f26dcff67.zip |
Fixed that render :partial would fail when :object was a Hash (due to backwards compatibility issues) #2148 [Sam Stephenson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2160 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/new_render_test.rb | 9 | ||||
-rw-r--r-- | actionpack/test/fixtures/test/_hash_object.rhtml | 1 |
2 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 7c829e68de..a1af0a0091 100644 --- a/actionpack/test/controller/new_render_test.rb +++ b/actionpack/test/controller/new_render_test.rb @@ -101,6 +101,10 @@ class NewRenderTestController < ActionController::Base def empty_partial_collection render :partial => "customer", :collection => [] end + + def partial_with_hash_object + render :partial => "hash_object", :object => {:first_name => "Sam"} + end def hello_in_a_string @customers = [ Customer.new("david"), Customer.new("mary") ] @@ -371,6 +375,11 @@ class NewRenderTest < Test::Unit::TestCase assert_equal " ", @response.body end + def test_partial_with_hash_object + get :partial_with_hash_object + assert_equal "Sam", @response.body + end + def test_render_text_with_assigns get :render_text_with_assigns assert_equal "world", assigns["hello"] diff --git a/actionpack/test/fixtures/test/_hash_object.rhtml b/actionpack/test/fixtures/test/_hash_object.rhtml new file mode 100644 index 0000000000..037a7368d6 --- /dev/null +++ b/actionpack/test/fixtures/test/_hash_object.rhtml @@ -0,0 +1 @@ +<%= hash_object[:first_name] %>
\ No newline at end of file |