Permalink
Browse files

Merge [5893] from trunk. References #2541.

git-svn-id: http://svn-commit.rubyonrails.org/rails/branches/1-2-pre-release@5894 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent f7d2595 commit 34603e7faf1880b1c7d1d4c9e064403ecfdef7fb @jeremy jeremy committed Jan 12, 2007
Showing with 13 additions and 1 deletion.
  1. +13 −1 actionpack/test/controller/new_render_test.rb
@@ -167,6 +167,12 @@ def render_to_string_with_assigns
@after = "i'm after the render"
render :action => "test/hello_world"
end
+
+ def render_to_string_with_partial
+ @partial_only = render_to_string :partial => "partial_only"
+ @partial_with_locals = render_to_string :partial => "customer", :locals => { :customer => Customer.new("david") }
+ render :action => "test/hello_world"
+ end
def render_to_string_with_exception
render_to_string :file => "exception that will not be caught - this will certainly not work", :use_full_path => true
@@ -555,7 +561,13 @@ def test_render_to_string_doesnt_break_assigns
assert_equal "i'm before the render", assigns(:before)
assert_equal "i'm after the render", assigns(:after)
end
-
+
+ def test_render_to_string_partial
+ get :render_to_string_with_partial
+ assert_equal "only partial", assigns(:partial_only)
+ assert_equal "Hello: david", assigns(:partial_with_locals)
+ end
+
def test_bad_render_to_string_still_throws_exception
assert_raises(ActionController::MissingTemplate) { get :render_to_string_with_exception }
end

0 comments on commit 34603e7

Please sign in to comment.