Skip to content
This repository
Browse code

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...
commit 34603e7faf1880b1c7d1d4c9e064403ecfdef7fb 1 parent f7d2595
Jeremy Kemper authored January 12, 2007
14  actionpack/test/controller/new_render_test.rb
@@ -167,6 +167,12 @@ def render_to_string_with_assigns
167 167
     @after = "i'm after the render"
168 168
     render :action => "test/hello_world"
169 169
   end
  170
+
  171
+ def render_to_string_with_partial
  172
+    @partial_only = render_to_string :partial => "partial_only"
  173
+    @partial_with_locals = render_to_string :partial => "customer", :locals => { :customer => Customer.new("david") }     
  174
+    render :action => "test/hello_world"  
  175
+  end  
170 176
   
171 177
   def render_to_string_with_exception
172 178
     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
555 561
     assert_equal "i'm before the render", assigns(:before)
556 562
     assert_equal "i'm after the render", assigns(:after)
557 563
   end
558  
-  
  564
+
  565
+  def test_render_to_string_partial
  566
+    get :render_to_string_with_partial
  567
+    assert_equal "only partial", assigns(:partial_only)
  568
+    assert_equal "Hello: david", assigns(:partial_with_locals)
  569
+  end  
  570
+
559 571
   def test_bad_render_to_string_still_throws_exception
560 572
     assert_raises(ActionController::MissingTemplate) { get :render_to_string_with_exception }
561 573
   end

0 notes on commit 34603e7

Please sign in to comment.
Something went wrong with that request. Please try again.