Skip to content
This repository
Browse code

Work with @output_buffer instead of _erbout

  • Loading branch information...
commit 0bdb7d353b4ac6f5470884360f9a480a16bd709c 1 parent 933697a
Jeremy Kemper authored June 02, 2008
11  actionpack/lib/action_view/base.rb
@@ -156,10 +156,12 @@ class Base
156 156
     attr_reader   :finder
157 157
     attr_accessor :base_path, :assigns, :template_extension, :first_render
158 158
     attr_accessor :controller
159  
-    
  159
+
160 160
     attr_writer :template_format
161 161
     attr_accessor :current_render_extension
162 162
 
  163
+    attr_accessor :output_buffer
  164
+
163 165
     # Specify trim mode for the ERB compiler. Defaults to '-'.
164 166
     # See ERb documentation for suitable values.
165 167
     @@erb_trim_mode = '-'
@@ -313,9 +315,10 @@ def template_format
313 315
 
314 316
     private
315 317
       def wrap_content_for_layout(content)
316  
-        original_content_for_layout = @content_for_layout
317  
-        @content_for_layout = content
318  
-        returning(yield) { @content_for_layout = original_content_for_layout }
  318
+        original_content_for_layout, @content_for_layout = @content_for_layout, content
  319
+        yield
  320
+      ensure
  321
+        @content_for_layout = original_content_for_layout
319 322
       end
320 323
 
321 324
       # Evaluate the local assigns and pushes them to the view.
18  actionpack/lib/action_view/helpers/capture_helper.rb
@@ -31,11 +31,11 @@ module CaptureHelper
31 31
       #   </body></html>
32 32
       #
33 33
       def capture(*args, &block)
34  
-        @output_buffer, old_buffer = '', @output_buffer
35  
-        yield *args
36  
-        @output_buffer
37  
-      ensure
38  
-        @output_buffer = old_buffer
  34
+        if @output_buffer
  35
+          with_temporary_output_buffer { yield *args }
  36
+        else
  37
+          block.call(*args)
  38
+        end
39 39
       end
40 40
 
41 41
       # Calling content_for stores a block of markup in an identifier for later use.
@@ -119,6 +119,14 @@ def content_for(name, content = nil, &block)
119 119
       end
120 120
 
121 121
       private
  122
+        def with_temporary_output_buffer
  123
+          @output_buffer, old_buffer = '', @output_buffer
  124
+          yield
  125
+          @output_buffer
  126
+        ensure
  127
+          @output_buffer = old_buffer
  128
+        end
  129
+
122 130
         def erb_content_for(name, &block)
123 131
           ivar = "@content_for_#{name}"
124 132
           instance_variable_set(ivar, "#{instance_variable_get(ivar)}#{capture(&block)}")
7  actionpack/lib/action_view/template_handlers/builder.rb
@@ -11,10 +11,11 @@ def self.line_offset
11 11
 
12 12
       def compile(template)
13 13
         content_type_handler = (@view.send!(:controller).respond_to?(:response) ? "controller.response" : "controller")
  14
+
14 15
         "#{content_type_handler}.content_type ||= Mime::XML\n" +
15  
-        "xml = ::Builder::XmlMarkup.new(:indent => 2)\n" +
16  
-        template.source +
17  
-        "\nxml.target!\n"
  16
+          "xml = ::Builder::XmlMarkup.new(:indent => 2)\n" +
  17
+          template.source +
  18
+          "\nxml.target!\n"
18 19
       end
19 20
 
20 21
       def cache_fragment(block, name = {}, options = nil)
2  actionpack/lib/action_view/template_handlers/erb.rb
@@ -47,7 +47,7 @@ def compile(template)
47 47
       end
48 48
 
49 49
       def cache_fragment(block, name = {}, options = nil) #:nodoc:
50  
-        @view.fragment_for(block, name, options) { @view.output_buffer }
  50
+        @view.fragment_for(block, name, options) { @view.response.template.output_buffer ||= '' }
51 51
       end
52 52
     end
53 53
   end
4  actionpack/test/controller/caching_test.rb
@@ -421,6 +421,8 @@ def setup
421 421
     @controller.request = @request
422 422
     @controller.response = @response
423 423
     @controller.send(:initialize_current_url)
  424
+    @controller.send(:initialize_template_class, @response)
  425
+    @controller.send(:assign_shortcuts, @request, @response)
424 426
   end
425 427
 
426 428
   def test_fragment_cache_key
@@ -510,7 +512,7 @@ def test_fragment_for
510 512
 
511 513
   def test_cache_erb_fragment
512 514
     @store.write('views/expensive', 'fragment content')
513  
-    _erbout = 'generated till now -> '
  515
+    @controller.template.output_buffer = 'generated till now -> '
514 516
 
515 517
     assert_equal( 'generated till now -> fragment content',
516 518
                   ActionView::TemplateHandlers::ERB.new(@controller).cache_fragment(Proc.new{ }, 'expensive'))
12  actionpack/test/template/date_helper_test.rb
@@ -1002,17 +1002,17 @@ def test_date_select_within_fields_for
1002 1002
     @post = Post.new
1003 1003
     @post.written_on = Date.new(2004, 6, 15)
1004 1004
 
1005  
-    _erbout = ''
  1005
+    @output_buffer = ''
1006 1006
 
1007 1007
     fields_for :post, @post do |f|
1008  
-      _erbout.concat f.date_select(:written_on)
  1008
+      @output_buffer.concat f.date_select(:written_on)
1009 1009
     end
1010 1010
 
1011 1011
     expected = "<select id='post_written_on_1i' name='post[written_on(1i)]'>\n<option value='1999'>1999</option>\n<option value='2000'>2000</option>\n<option value='2001'>2001</option>\n<option value='2002'>2002</option>\n<option value='2003'>2003</option>\n<option selected='selected' value='2004'>2004</option>\n<option value='2005'>2005</option>\n<option value='2006'>2006</option>\n<option value='2007'>2007</option>\n<option value='2008'>2008</option>\n<option value='2009'>2009</option>\n</select>\n"
1012 1012
     expected << "<select id='post_written_on_2i' name='post[written_on(2i)]'>\n<option value='1'>January</option>\n<option value='2'>February</option>\n<option value='3'>March</option>\n<option value='4'>April</option>\n<option value='5'>May</option>\n<option selected='selected' value='6'>June</option>\n<option value='7'>July</option>\n<option value='8'>August</option>\n<option value='9'>September</option>\n<option value='10'>October</option>\n<option value='11'>November</option>\n<option value='12'>December</option>\n</select>\n"
1013 1013
     expected << "<select id='post_written_on_3i' name='post[written_on(3i)]'>\n<option value='1'>1</option>\n<option value='2'>2</option>\n<option value='3'>3</option>\n<option value='4'>4</option>\n<option value='5'>5</option>\n<option value='6'>6</option>\n<option value='7'>7</option>\n<option value='8'>8</option>\n<option value='9'>9</option>\n<option value='10'>10</option>\n<option value='11'>11</option>\n<option value='12'>12</option>\n<option value='13'>13</option>\n<option value='14'>14</option>\n<option selected='selected' value='15'>15</option>\n<option value='16'>16</option>\n<option value='17'>17</option>\n<option value='18'>18</option>\n<option value='19'>19</option>\n<option value='20'>20</option>\n<option value='21'>21</option>\n<option value='22'>22</option>\n<option value='23'>23</option>\n<option value='24'>24</option>\n<option value='25'>25</option>\n<option value='26'>26</option>\n<option value='27'>27</option>\n<option value='28'>28</option>\n<option value='29'>29</option>\n<option value='30'>30</option>\n<option value='31'>31</option>\n</select>\n"
1014 1014
 
1015  
-    assert_dom_equal(expected, _erbout)
  1015
+    assert_dom_equal(expected, @output_buffer)
1016 1016
   end
1017 1017
 
1018 1018
   def test_date_select_with_index
@@ -1287,10 +1287,10 @@ def test_datetime_select_within_fields_for
1287 1287
     @post = Post.new
1288 1288
     @post.updated_at = Time.local(2004, 6, 15, 16, 35)
1289 1289
 
1290  
-    _erbout = ''
  1290
+    @output_buffer = ''
1291 1291
 
1292 1292
     fields_for :post, @post do |f|
1293  
-      _erbout.concat f.datetime_select(:updated_at)
  1293
+      @output_buffer.concat f.datetime_select(:updated_at)
1294 1294
     end
1295 1295
 
1296 1296
     expected = "<select id='post_updated_at_1i' name='post[updated_at(1i)]'>\n<option value='1999'>1999</option>\n<option value='2000'>2000</option>\n<option value='2001'>2001</option>\n<option value='2002'>2002</option>\n<option value='2003'>2003</option>\n<option selected='selected' value='2004'>2004</option>\n<option value='2005'>2005</option>\n<option value='2006'>2006</option>\n<option value='2007'>2007</option>\n<option value='2008'>2008</option>\n<option value='2009'>2009</option>\n</select>\n"
@@ -1299,7 +1299,7 @@ def test_datetime_select_within_fields_for
1299 1299
    expected << " &mdash; <select id='post_updated_at_4i' name='post[updated_at(4i)]'>\n<option value='00'>00</option>\n<option value='01'>01</option>\n<option value='02'>02</option>\n<option value='03'>03</option>\n<option value='04'>04</option>\n<option value='05'>05</option>\n<option value='06'>06</option>\n<option value='07'>07</option>\n<option value='08'>08</option>\n<option value='09'>09</option>\n<option value='10'>10</option>\n<option value='11'>11</option>\n<option value='12'>12</option>\n<option value='13'>13</option>\n<option value='14'>14</option>\n<option value='15'>15</option>\n<option selected='selected' value='16'>16</option>\n<option value='17'>17</option>\n<option value='18'>18</option>\n<option value='19'>19</option>\n<option value='20'>20</option>\n<option value='21'>21</option>\n<option value='22'>22</option>\n<option value='23'>23</option>\n</select>\n"
1300 1300
   expected << " : <select id='post_updated_at_5i' name='post[updated_at(5i)]'>\n<option value='00'>00</option>\n<option value='01'>01</option>\n<option value='02'>02</option>\n<option value='03'>03</option>\n<option value='04'>04</option>\n<option value='05'>05</option>\n<option value='06'>06</option>\n<option value='07'>07</option>\n<option value='08'>08</option>\n<option value='09'>09</option>\n<option value='10'>10</option>\n<option value='11'>11</option>\n<option value='12'>12</option>\n<option value='13'>13</option>\n<option value='14'>14</option>\n<option value='15'>15</option>\n<option value='16'>16</option>\n<option value='17'>17</option>\n<option value='18'>18</option>\n<option value='19'>19</option>\n<option value='20'>20</option>\n<option value='21'>21</option>\n<option value='22'>22</option>\n<option value='23'>23</option>\n<option value='24'>24</option>\n<option value='25'>25</option>\n<option value='26'>26</option>\n<option value='27'>27</option>\n<option value='28'>28</option>\n<option value='29'>29</option>\n<option value='30'>30</option>\n<option value='31'>31</option>\n<option value='32'>32</option>\n<option value='33'>33</option>\n<option value='34'>34</option>\n<option selected='selected' value='35'>35</option>\n<option value='36'>36</option>\n<option value='37'>37</option>\n<option value='38'>38</option>\n<option value='39'>39</option>\n<option value='40'>40</option>\n<option value='41'>41</option>\n<option value='42'>42</option>\n<option value='43'>43</option>\n<option value='44'>44</option>\n<option value='45'>45</option>\n<option value='46'>46</option>\n<option value='47'>47</option>\n<option value='48'>48</option>\n<option value='49'>49</option>\n<option value='50'>50</option>\n<option value='51'>51</option>\n<option value='52'>52</option>\n<option value='53'>53</option>\n<option value='54'>54</option>\n<option value='55'>55</option>\n<option value='56'>56</option>\n<option value='57'>57</option>\n<option value='58'>58</option>\n<option value='59'>59</option>\n</select>\n"
1301 1301
 
1302  
-    assert_dom_equal(expected, _erbout)
  1302
+    assert_dom_equal(expected, @output_buffer)
1303 1303
   end
1304 1304
 
1305 1305
   def test_date_select_with_zero_value_and_no_start_year
260  actionpack/test/template/form_helper_test.rb
@@ -337,14 +337,14 @@ def test_auto_index
337 337
   end
338 338
 
339 339
   def test_form_for
340  
-    _erbout = ''
  340
+    @output_buffer = ''
341 341
 
342 342
     form_for(:post, @post, :html => { :id => 'create-post' }) do |f|
343  
-      _erbout.concat f.label(:title)
344  
-      _erbout.concat f.text_field(:title)
345  
-      _erbout.concat f.text_area(:body)
346  
-      _erbout.concat f.check_box(:secret)
347  
-      _erbout.concat f.submit('Create post')
  343
+      @output_buffer.concat f.label(:title)
  344
+      @output_buffer.concat f.text_field(:title)
  345
+      @output_buffer.concat f.text_area(:body)
  346
+      @output_buffer.concat f.check_box(:secret)
  347
+      @output_buffer.concat f.submit('Create post')
348 348
     end
349 349
 
350 350
     expected =
@@ -357,16 +357,16 @@ def test_form_for
357 357
       "<input name='commit' id='post_submit' type='submit' value='Create post' />" +
358 358
       "</form>"
359 359
 
360  
-    assert_dom_equal expected, _erbout
  360
+    assert_dom_equal expected, @output_buffer
361 361
   end
362 362
 
363 363
   def test_form_for_with_method
364  
-    _erbout = ''
  364
+    @output_buffer = ''
365 365
 
366 366
     form_for(:post, @post, :html => { :id => 'create-post', :method => :put }) do |f|
367  
-      _erbout.concat f.text_field(:title)
368  
-      _erbout.concat f.text_area(:body)
369  
-      _erbout.concat f.check_box(:secret)
  367
+      @output_buffer.concat f.text_field(:title)
  368
+      @output_buffer.concat f.text_area(:body)
  369
+      @output_buffer.concat f.check_box(:secret)
370 370
     end
371 371
 
372 372
     expected =
@@ -378,16 +378,16 @@ def test_form_for_with_method
378 378
       "<input name='post[secret]' type='hidden' value='0' />" +
379 379
       "</form>"
380 380
 
381  
-    assert_dom_equal expected, _erbout
  381
+    assert_dom_equal expected, @output_buffer
382 382
   end
383 383
 
384 384
   def test_form_for_without_object
385  
-    _erbout = ''
  385
+    @output_buffer = ''
386 386
 
387 387
     form_for(:post, :html => { :id => 'create-post' }) do |f|
388  
-      _erbout.concat f.text_field(:title)
389  
-      _erbout.concat f.text_area(:body)
390  
-      _erbout.concat f.check_box(:secret)
  388
+      @output_buffer.concat f.text_field(:title)
  389
+      @output_buffer.concat f.text_area(:body)
  390
+      @output_buffer.concat f.check_box(:secret)
391 391
     end
392 392
 
393 393
     expected =
@@ -398,17 +398,17 @@ def test_form_for_without_object
398 398
       "<input name='post[secret]' type='hidden' value='0' />" +
399 399
       "</form>"
400 400
 
401  
-    assert_dom_equal expected, _erbout
  401
+    assert_dom_equal expected, @output_buffer
402 402
   end
403 403
 
404 404
   def test_form_for_with_index
405  
-    _erbout = ''
  405
+    @output_buffer = ''
406 406
 
407 407
     form_for("post[]", @post) do |f|
408  
-      _erbout.concat f.label(:title)
409  
-      _erbout.concat f.text_field(:title)
410  
-      _erbout.concat f.text_area(:body)
411  
-      _erbout.concat f.check_box(:secret)
  408
+      @output_buffer.concat f.label(:title)
  409
+      @output_buffer.concat f.text_field(:title)
  410
+      @output_buffer.concat f.text_area(:body)
  411
+      @output_buffer.concat f.check_box(:secret)
412 412
     end
413 413
 
414 414
     expected =
@@ -420,16 +420,16 @@ def test_form_for_with_index
420 420
       "<input name='post[123][secret]' type='hidden' value='0' />" +
421 421
       "</form>"
422 422
 
423  
-    assert_dom_equal expected, _erbout
  423
+    assert_dom_equal expected, @output_buffer
424 424
   end
425 425
 
426 426
   def test_form_for_with_nil_index_option_override
427  
-    _erbout = ''
  427
+    @output_buffer = ''
428 428
 
429 429
     form_for("post[]", @post, :index => nil) do |f|
430  
-      _erbout.concat f.text_field(:title)
431  
-      _erbout.concat f.text_area(:body)
432  
-      _erbout.concat f.check_box(:secret)
  430
+      @output_buffer.concat f.text_field(:title)
  431
+      @output_buffer.concat f.text_area(:body)
  432
+      @output_buffer.concat f.check_box(:secret)
433 433
     end
434 434
 
435 435
     expected =
@@ -440,14 +440,14 @@ def test_form_for_with_nil_index_option_override
440 440
       "<input name='post[][secret]' type='hidden' value='0' />" +
441 441
       "</form>"
442 442
 
443  
-    assert_dom_equal expected, _erbout
  443
+    assert_dom_equal expected, @output_buffer
444 444
   end
445 445
 
446 446
   def test_nested_fields_for
447  
-    _erbout = ''
  447
+    @output_buffer = ''
448 448
     form_for(:post, @post) do |f|
449 449
       f.fields_for(:comment, @post) do |c|
450  
-        _erbout.concat c.text_field(:title)
  450
+        @output_buffer.concat c.text_field(:title)
451 451
       end
452 452
     end
453 453
 
@@ -455,16 +455,16 @@ def test_nested_fields_for
455 455
                "<input name='post[comment][title]' size='30' type='text' id='post_comment_title' value='Hello World' />" +
456 456
                "</form>"
457 457
 
458  
-    assert_dom_equal expected, _erbout
  458
+    assert_dom_equal expected, @output_buffer
459 459
   end
460 460
 
461 461
   def test_fields_for
462  
-    _erbout = ''
  462
+    @output_buffer = ''
463 463
 
464 464
     fields_for(:post, @post) do |f|
465  
-      _erbout.concat f.text_field(:title)
466  
-      _erbout.concat f.text_area(:body)
467  
-      _erbout.concat f.check_box(:secret)
  465
+      @output_buffer.concat f.text_field(:title)
  466
+      @output_buffer.concat f.text_area(:body)
  467
+      @output_buffer.concat f.check_box(:secret)
468 468
     end
469 469
 
470 470
     expected =
@@ -473,16 +473,16 @@ def test_fields_for
473 473
       "<input name='post[secret]' checked='checked' type='checkbox' id='post_secret' value='1' />" +
474 474
       "<input name='post[secret]' type='hidden' value='0' />"
475 475
 
476  
-    assert_dom_equal expected, _erbout
  476
+    assert_dom_equal expected, @output_buffer
477 477
   end
478 478
 
479 479
   def test_fields_for_with_index
480  
-    _erbout = ''
  480
+    @output_buffer = ''
481 481
 
482 482
     fields_for("post[]", @post) do |f|
483  
-      _erbout.concat f.text_field(:title)
484  
-      _erbout.concat f.text_area(:body)
485  
-      _erbout.concat f.check_box(:secret)
  483
+      @output_buffer.concat f.text_field(:title)
  484
+      @output_buffer.concat f.text_area(:body)
  485
+      @output_buffer.concat f.check_box(:secret)
486 486
     end
487 487
 
488 488
     expected =
@@ -491,16 +491,16 @@ def test_fields_for_with_index
491 491
       "<input name='post[123][secret]' checked='checked' type='checkbox' id='post_123_secret' value='1' />" +
492 492
       "<input name='post[123][secret]' type='hidden' value='0' />"
493 493
 
494  
-    assert_dom_equal expected, _erbout
  494
+    assert_dom_equal expected, @output_buffer
495 495
   end
496 496
 
497 497
   def test_fields_for_with_nil_index_option_override
498  
-    _erbout = ''
  498
+    @output_buffer = ''
499 499
 
500 500
     fields_for("post[]", @post, :index => nil) do |f|
501  
-      _erbout.concat f.text_field(:title)
502  
-      _erbout.concat f.text_area(:body)
503  
-      _erbout.concat f.check_box(:secret)
  501
+      @output_buffer.concat f.text_field(:title)
  502
+      @output_buffer.concat f.text_area(:body)
  503
+      @output_buffer.concat f.check_box(:secret)
504 504
     end
505 505
 
506 506
     expected =
@@ -509,16 +509,16 @@ def test_fields_for_with_nil_index_option_override
509 509
       "<input name='post[][secret]' checked='checked' type='checkbox' id='post__secret' value='1' />" +
510 510
       "<input name='post[][secret]' type='hidden' value='0' />"
511 511
 
512  
-    assert_dom_equal expected, _erbout
  512
+    assert_dom_equal expected, @output_buffer
513 513
   end
514 514
 
515 515
   def test_fields_for_with_index_option_override
516  
-    _erbout = ''
  516
+    @output_buffer = ''
517 517
 
518 518
     fields_for("post[]", @post, :index => "abc") do |f|
519  
-      _erbout.concat f.text_field(:title)
520  
-      _erbout.concat f.text_area(:body)
521  
-      _erbout.concat f.check_box(:secret)
  519
+      @output_buffer.concat f.text_field(:title)
  520
+      @output_buffer.concat f.text_area(:body)
  521
+      @output_buffer.concat f.check_box(:secret)
522 522
     end
523 523
 
524 524
     expected =
@@ -527,15 +527,15 @@ def test_fields_for_with_index_option_override
527 527
       "<input name='post[abc][secret]' checked='checked' type='checkbox' id='post_abc_secret' value='1' />" +
528 528
       "<input name='post[abc][secret]' type='hidden' value='0' />"
529 529
 
530  
-    assert_dom_equal expected, _erbout
  530
+    assert_dom_equal expected, @output_buffer
531 531
   end
532 532
 
533 533
   def test_fields_for_without_object
534  
-    _erbout = ''
  534
+    @output_buffer = ''
535 535
     fields_for(:post) do |f|
536  
-      _erbout.concat f.text_field(:title)
537  
-      _erbout.concat f.text_area(:body)
538  
-      _erbout.concat f.check_box(:secret)
  536
+      @output_buffer.concat f.text_field(:title)
  537
+      @output_buffer.concat f.text_area(:body)
  538
+      @output_buffer.concat f.check_box(:secret)
539 539
     end
540 540
 
541 541
     expected =
@@ -544,15 +544,15 @@ def test_fields_for_without_object
544 544
       "<input name='post[secret]' checked='checked' type='checkbox' id='post_secret' value='1' />" +
545 545
       "<input name='post[secret]' type='hidden' value='0' />"
546 546
 
547  
-    assert_dom_equal expected, _erbout
  547
+    assert_dom_equal expected, @output_buffer
548 548
   end
549 549
 
550 550
   def test_fields_for_with_only_object
551  
-    _erbout = ''
  551
+    @output_buffer = ''
552 552
     fields_for(@post) do |f|
553  
-      _erbout.concat f.text_field(:title)
554  
-      _erbout.concat f.text_area(:body)
555  
-      _erbout.concat f.check_box(:secret)
  553
+      @output_buffer.concat f.text_field(:title)
  554
+      @output_buffer.concat f.text_area(:body)
  555
+      @output_buffer.concat f.check_box(:secret)
556 556
     end
557 557
 
558 558
     expected =
@@ -561,31 +561,31 @@ def test_fields_for_with_only_object
561 561
       "<input name='post[secret]' checked='checked' type='checkbox' id='post_secret' value='1' />" +
562 562
       "<input name='post[secret]' type='hidden' value='0' />"
563 563
 
564  
-    assert_dom_equal expected, _erbout
  564
+    assert_dom_equal expected, @output_buffer
565 565
   end
566 566
 
567 567
   def test_fields_for_object_with_bracketed_name
568  
-    _erbout = ''
  568
+    @output_buffer = ''
569 569
     fields_for("author[post]", @post) do |f|
570  
-      _erbout.concat f.label(:title)
571  
-      _erbout.concat f.text_field(:title)
  570
+      @output_buffer.concat f.label(:title)
  571
+      @output_buffer.concat f.text_field(:title)
572 572
     end
573 573
 
574 574
     assert_dom_equal "<label for=\"author_post_title\">Title</label>" +
575 575
     "<input name='author[post][title]' size='30' type='text' id='author_post_title' value='Hello World' />",
576  
-      _erbout
  576
+      @output_buffer
577 577
   end
578 578
 
579 579
   def test_fields_for_object_with_bracketed_name_and_index
580  
-    _erbout = ''
  580
+    @output_buffer = ''
581 581
     fields_for("author[post]", @post, :index => 1) do |f|
582  
-      _erbout.concat f.label(:title)
583  
-      _erbout.concat f.text_field(:title)
  582
+      @output_buffer.concat f.label(:title)
  583
+      @output_buffer.concat f.text_field(:title)
584 584
     end
585 585
 
586 586
     assert_dom_equal "<label for=\"author_post_1_title\">Title</label>" +
587 587
       "<input name='author[post][1][title]' size='30' type='text' id='author_post_1_title' value='Hello World' />",
588  
-      _erbout
  588
+      @output_buffer
589 589
   end
590 590
 
591 591
   def test_form_builder_does_not_have_form_for_method
@@ -593,14 +593,14 @@ def test_form_builder_does_not_have_form_for_method
593 593
   end
594 594
 
595 595
   def test_form_for_and_fields_for
596  
-    _erbout = ''
  596
+    @output_buffer = ''
597 597
 
598 598
     form_for(:post, @post, :html => { :id => 'create-post' }) do |post_form|
599  
-      _erbout.concat post_form.text_field(:title)
600  
-      _erbout.concat post_form.text_area(:body)
  599
+      @output_buffer.concat post_form.text_field(:title)
  600
+      @output_buffer.concat post_form.text_area(:body)
601 601
 
602 602
       fields_for(:parent_post, @post) do |parent_fields|
603  
-        _erbout.concat parent_fields.check_box(:secret)
  603
+        @output_buffer.concat parent_fields.check_box(:secret)
604 604
       end
605 605
     end
606 606
 
@@ -612,18 +612,18 @@ def test_form_for_and_fields_for
612 612
       "<input name='parent_post[secret]' type='hidden' value='0' />" +
613 613
       "</form>"
614 614
 
615  
-    assert_dom_equal expected, _erbout
  615
+    assert_dom_equal expected, @output_buffer
616 616
   end
617 617
 
618 618
   def test_form_for_and_fields_for_with_object
619  
-    _erbout = ''
  619
+    @output_buffer = ''
620 620
 
621 621
     form_for(:post, @post, :html => { :id => 'create-post' }) do |post_form|
622  
-      _erbout.concat post_form.text_field(:title)
623  
-      _erbout.concat post_form.text_area(:body)
  622
+      @output_buffer.concat post_form.text_field(:title)
  623
+      @output_buffer.concat post_form.text_area(:body)
624 624
 
625 625
       post_form.fields_for(@comment) do |comment_fields|
626  
-        _erbout.concat comment_fields.text_field(:name)
  626
+        @output_buffer.concat comment_fields.text_field(:name)
627 627
       end
628 628
     end
629 629
 
@@ -634,7 +634,7 @@ def test_form_for_and_fields_for_with_object
634 634
       "<input name='post[comment][name]' type='text' id='post_comment_name' value='new comment' size='30' />" +
635 635
       "</form>"
636 636
 
637  
-    assert_dom_equal expected, _erbout
  637
+    assert_dom_equal expected, @output_buffer
638 638
   end
639 639
 
640 640
   class LabelledFormBuilder < ActionView::Helpers::FormBuilder
@@ -649,12 +649,12 @@ def #{selector}(field, *args, &proc)
649 649
   end
650 650
 
651 651
   def test_form_for_with_labelled_builder
652  
-    _erbout = ''
  652
+    @output_buffer = ''
653 653
 
654 654
     form_for(:post, @post, :builder => LabelledFormBuilder) do |f|
655  
-      _erbout.concat f.text_field(:title)
656  
-      _erbout.concat f.text_area(:body)
657  
-      _erbout.concat f.check_box(:secret)
  655
+      @output_buffer.concat f.text_field(:title)
  656
+      @output_buffer.concat f.text_area(:body)
  657
+      @output_buffer.concat f.check_box(:secret)
658 658
     end
659 659
 
660 660
     expected =
@@ -665,18 +665,18 @@ def test_form_for_with_labelled_builder
665 665
       "<input name='post[secret]' type='hidden' value='0' /><br/>" +
666 666
       "</form>"
667 667
 
668  
-    assert_dom_equal expected, _erbout
  668
+    assert_dom_equal expected, @output_buffer
669 669
   end
670 670
 
671 671
   def test_default_form_builder
672 672
     old_default_form_builder, ActionView::Base.default_form_builder =
673 673
       ActionView::Base.default_form_builder, LabelledFormBuilder
674 674
 
675  
-    _erbout = ''
  675
+    @output_buffer = ''
676 676
     form_for(:post, @post) do |f|
677  
-      _erbout.concat f.text_field(:title)
678  
-      _erbout.concat f.text_area(:body)
679  
-      _erbout.concat f.check_box(:secret)
  677
+      @output_buffer.concat f.text_field(:title)
  678
+      @output_buffer.concat f.text_area(:body)
  679
+      @output_buffer.concat f.check_box(:secret)
680 680
     end
681 681
 
682 682
     expected =
@@ -687,17 +687,17 @@ def test_default_form_builder
687 687
       "<input name='post[secret]' type='hidden' value='0' /><br/>" +
688 688
       "</form>"
689 689
 
690  
-    assert_dom_equal expected, _erbout
  690
+    assert_dom_equal expected, @output_buffer
691 691
   ensure
692 692
     ActionView::Base.default_form_builder = old_default_form_builder
693 693
   end
694 694
 
695 695
   def test_default_form_builder_with_active_record_helpers
696 696
 
697  
-    _erbout = ''
  697
+    @output_buffer = ''
698 698
     form_for(:post, @post) do |f|
699  
-       _erbout.concat f.error_message_on('author_name')
700  
-       _erbout.concat f.error_messages
  699
+       @output_buffer.concat f.error_message_on('author_name')
  700
+       @output_buffer.concat f.error_messages
701 701
     end
702 702
 
703 703
     expected = %(<form action='http://www.example.com' method='post'>) +
@@ -705,7 +705,7 @@ def test_default_form_builder_with_active_record_helpers
705 705
                %(<div class="errorExplanation" id="errorExplanation"><h2>1 error prohibited this post from being saved</h2><p>There were problems with the following fields:</p><ul><li>Author name can't be empty</li></ul></div>) +
706 706
                %(</form>)
707 707
 
708  
-    assert_dom_equal expected, _erbout
  708
+    assert_dom_equal expected, @output_buffer
709 709
 
710 710
   end
711 711
 
@@ -713,10 +713,10 @@ def test_default_form_builder_no_instance_variable
713 713
     post = @post
714 714
     @post = nil
715 715
 
716  
-    _erbout = ''
  716
+    @output_buffer = ''
717 717
     form_for(:post, post) do |f|
718  
-       _erbout.concat f.error_message_on('author_name')
719  
-       _erbout.concat f.error_messages
  718
+       @output_buffer.concat f.error_message_on('author_name')
  719
+       @output_buffer.concat f.error_messages
720 720
     end
721 721
 
722 722
     expected = %(<form action='http://www.example.com' method='post'>) +
@@ -724,19 +724,19 @@ def test_default_form_builder_no_instance_variable
724 724
                %(<div class="errorExplanation" id="errorExplanation"><h2>1 error prohibited this post from being saved</h2><p>There were problems with the following fields:</p><ul><li>Author name can't be empty</li></ul></div>) +
725 725
                %(</form>)
726 726
 
727  
-    assert_dom_equal expected, _erbout
  727
+    assert_dom_equal expected, @output_buffer
728 728
 
729 729
   end
730 730
 
731 731
   # Perhaps this test should be moved to prototype helper tests.
732 732
   def test_remote_form_for_with_labelled_builder
733 733
     self.extend ActionView::Helpers::PrototypeHelper
734  
-     _erbout = ''
  734
+     @output_buffer = ''
735 735
 
736 736
      remote_form_for(:post, @post, :builder => LabelledFormBuilder) do |f|
737  
-       _erbout.concat f.text_field(:title)
738  
-       _erbout.concat f.text_area(:body)
739  
-       _erbout.concat f.check_box(:secret)
  737
+       @output_buffer.concat f.text_field(:title)
  738
+       @output_buffer.concat f.text_area(:body)
  739
+       @output_buffer.concat f.check_box(:secret)
740 740
      end
741 741
 
742 742
      expected =
@@ -747,16 +747,16 @@ def test_remote_form_for_with_labelled_builder
747 747
        "<input name='post[secret]' type='hidden' value='0' /><br/>" +
748 748
        "</form>"
749 749
 
750  
-     assert_dom_equal expected, _erbout
  750
+     assert_dom_equal expected, @output_buffer
751 751
   end
752 752
 
753 753
   def test_fields_for_with_labelled_builder
754  
-    _erbout = ''
  754
+    @output_buffer = ''
755 755
 
756 756
     fields_for(:post, @post, :builder => LabelledFormBuilder) do |f|
757  
-      _erbout.concat f.text_field(:title)
758  
-      _erbout.concat f.text_area(:body)
759  
-      _erbout.concat f.check_box(:secret)
  757
+      @output_buffer.concat f.text_field(:title)
  758
+      @output_buffer.concat f.text_area(:body)
  759
+      @output_buffer.concat f.check_box(:secret)
760 760
     end
761 761
 
762 762
     expected =
@@ -765,28 +765,28 @@ def test_fields_for_with_labelled_builder
765 765
       "<label for='secret'>Secret:</label> <input name='post[secret]' checked='checked' type='checkbox' id='post_secret' value='1' />" +
766 766
       "<input name='post[secret]' type='hidden' value='0' /><br/>"
767 767
 
768  
-    assert_dom_equal expected, _erbout
  768
+    assert_dom_equal expected, @output_buffer
769 769
   end
770 770
 
771 771
   def test_form_for_with_html_options_adds_options_to_form_tag
772  
-    _erbout = ''
  772
+    @output_buffer = ''
773 773
 
774 774
     form_for(:post, @post, :html => {:id => 'some_form', :class => 'some_class'}) do |f| end
775 775
     expected = "<form action=\"http://www.example.com\" class=\"some_class\" id=\"some_form\" method=\"post\"></form>"
776 776
 
777  
-    assert_dom_equal expected, _erbout
  777
+    assert_dom_equal expected, @output_buffer
778 778
   end
779 779
 
780 780
   def test_form_for_with_string_url_option
781  
-    _erbout = ''
  781
+    @output_buffer = ''
782 782
 
783 783
     form_for(:post, @post, :url => 'http://www.otherdomain.com') do |f| end
784 784
 
785  
-    assert_equal '<form action="http://www.otherdomain.com" method="post"></form>', _erbout
  785
+    assert_equal '<form action="http://www.otherdomain.com" method="post"></form>', @output_buffer
786 786
   end
787 787
 
788 788
   def test_form_for_with_hash_url_option
789  
-    _erbout = ''
  789
+    @output_buffer = ''
790 790
 
791 791
     form_for(:post, @post, :url => {:controller => 'controller', :action => 'action'}) do |f| end
792 792
 
@@ -795,25 +795,25 @@ def test_form_for_with_hash_url_option
795 795
   end
796 796
 
797 797
   def test_form_for_with_record_url_option
798  
-    _erbout = ''
  798
+    @output_buffer = ''
799 799
 
800 800
     form_for(:post, @post, :url => @post) do |f| end
801 801
 
802 802
     expected = "<form action=\"/posts/123\" method=\"post\"></form>"
803  
-    assert_equal expected, _erbout
  803
+    assert_equal expected, @output_buffer
804 804
   end
805 805
 
806 806
   def test_form_for_with_existing_object
807  
-    _erbout = ''
  807
+    @output_buffer = ''
808 808
 
809 809
     form_for(@post) do |f| end
810 810
 
811 811
     expected = "<form action=\"/posts/123\" class=\"edit_post\" id=\"edit_post_123\" method=\"post\"><div style=\"margin:0;padding:0\"><input name=\"_method\" type=\"hidden\" value=\"put\" /></div></form>"
812  
-    assert_equal expected, _erbout
  812
+    assert_equal expected, @output_buffer
813 813
   end
814 814
 
815 815
   def test_form_for_with_new_object
816  
-    _erbout = ''
  816
+    @output_buffer = ''
817 817
 
818 818
     post = Post.new
819 819
     post.new_record = true
@@ -822,64 +822,64 @@ def post.id() nil end
822 822
     form_for(post) do |f| end
823 823
 
824 824
     expected = "<form action=\"/posts\" class=\"new_post\" id=\"new_post\" method=\"post\"></form>"
825  
-    assert_equal expected, _erbout
  825
+    assert_equal expected, @output_buffer
826 826
   end
827 827
 
828 828
   def test_form_for_with_existing_object_in_list
829 829
     @post.new_record = false
830 830
     @comment.save
831  
-    _erbout = ''
  831
+    @output_buffer = ''
832 832
     form_for([@post, @comment]) {}
833 833
 
834 834
     expected = %(<form action="#{comment_path(@post, @comment)}" class="edit_comment" id="edit_comment_1" method="post"><div style="margin:0;padding:0"><input name="_method" type="hidden" value="put" /></div></form>)
835  
-    assert_dom_equal expected, _erbout
  835
+    assert_dom_equal expected, @output_buffer
836 836
   end
837 837
 
838 838
   def test_form_for_with_new_object_in_list
839 839
     @post.new_record = false
840  
-    _erbout = ''
  840
+    @output_buffer = ''
841 841
     form_for([@post, @comment]) {}
842 842
 
843 843
     expected = %(<form action="#{comments_path(@post)}" class="new_comment" id="new_comment" method="post"></form>)
844  
-    assert_dom_equal expected, _erbout
  844
+    assert_dom_equal expected, @output_buffer
845 845
   end
846 846
 
847 847
   def test_form_for_with_existing_object_and_namespace_in_list
848 848
     @post.new_record = false
849 849
     @comment.save
850  
-    _erbout = ''
  850
+    @output_buffer = ''
851 851
     form_for([:admin, @post, @comment]) {}
852 852
 
853 853
     expected = %(<form action="#{admin_comment_path(@post, @comment)}" class="edit_comment" id="edit_comment_1" method="post"><div style="margin:0;padding:0"><input name="_method" type="hidden" value="put" /></div></form>)
854  
-    assert_dom_equal expected, _erbout
  854
+    assert_dom_equal expected, @output_buffer
855 855
   end
856 856
 
857 857
   def test_form_for_with_new_object_and_namespace_in_list
858 858
     @post.new_record = false
859  
-    _erbout = ''
  859
+    @output_buffer = ''
860 860
     form_for([:admin, @post, @comment]) {}
861 861
 
862 862
     expected = %(<form action="#{admin_comments_path(@post)}" class="new_comment" id="new_comment" method="post"></form>)
863  
-    assert_dom_equal expected, _erbout
  863
+    assert_dom_equal expected, @output_buffer
864 864
   end
865 865
 
866 866
   def test_form_for_with_existing_object_and_custom_url
867  
-    _erbout = ''
  867
+    @output_buffer = ''
868 868
 
869 869
     form_for(@post, :url => "/super_posts") do |f| end
870 870
 
871 871
     expected = "<form action=\"/super_posts\" class=\"edit_post\" id=\"edit_post_123\" method=\"post\"><div style=\"margin:0;padding:0\"><input name=\"_method\" type=\"hidden\" value=\"put\" /></div></form>"
872  
-    assert_equal expected, _erbout
  872
+    assert_equal expected, @output_buffer
873 873
   end
874 874
 
875 875
   def test_remote_form_for_with_html_options_adds_options_to_form_tag
876 876
     self.extend ActionView::Helpers::PrototypeHelper
877  
-    _erbout = ''
  877
+    @output_buffer = ''
878 878
 
879 879
     remote_form_for(:post, @post, :html => {:id => 'some_form', :class => 'some_class'}) do |f| end
880 880
     expected = "<form action=\"http://www.example.com\" class=\"some_class\" id=\"some_form\" method=\"post\" onsubmit=\"new Ajax.Request('http://www.example.com', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;\"></form>"
881 881
 
882  
-    assert_dom_equal expected, _erbout
  882
+    assert_dom_equal expected, @output_buffer
883 883
   end
884 884
 
885 885
 
18  actionpack/test/template/form_options_helper_test.rb
@@ -231,15 +231,15 @@ def test_select_under_fields_for
231 231
     @post = Post.new
232 232
     @post.category = "<mus>"
233 233
     
234  
-    _erbout = ''
  234
+    @output_buffer = ''
235 235
     
236 236
     fields_for :post, @post do |f|
237  
-      _erbout.concat f.select(:category, %w( abe <mus> hest))
  237
+      @output_buffer.concat f.select(:category, %w( abe <mus> hest))
238 238
     end
239 239
     
240 240
     assert_dom_equal(
241 241
       "<select id=\"post_category\" name=\"post[category]\"><option value=\"abe\">abe</option>\n<option value=\"&lt;mus&gt;\" selected=\"selected\">&lt;mus&gt;</option>\n<option value=\"hest\">hest</option></select>",
242  
-      _erbout
  242
+      @output_buffer
243 243
     )
244 244
   end
245 245
 
@@ -353,15 +353,15 @@ def test_collection_select_under_fields_for
353 353
     @post = Post.new
354 354
     @post.author_name = "Babe"
355 355
     
356  
-    _erbout = ''
  356
+    @output_buffer = ''
357 357
     
358 358
     fields_for :post, @post do |f|
359  
-      _erbout.concat f.collection_select(:author_name, @posts, :author_name, :author_name)
  359
+      @output_buffer.concat f.collection_select(:author_name, @posts, :author_name, :author_name)
360 360
     end
361 361
     
362 362
     assert_dom_equal(
363 363
       "<select id=\"post_author_name\" name=\"post[author_name]\"><option value=\"&lt;Abe&gt;\">&lt;Abe&gt;</option>\n<option value=\"Babe\" selected=\"selected\">Babe</option>\n<option value=\"Cabe\">Cabe</option></select>",
364  
-      _erbout
  364
+      @output_buffer
365 365
     )
366 366
   end
367 367
 
@@ -1195,10 +1195,10 @@ def test_time_zone_select
1195 1195
   def test_time_zone_select_under_fields_for
1196 1196
     @firm = Firm.new("D")
1197 1197
     
1198  
-    _erbout = ''
  1198
+    @output_buffer = ''
1199 1199
     
1200 1200
     fields_for :firm, @firm do |f|
1201  
-      _erbout.concat f.time_zone_select(:time_zone)
  1201
+      @output_buffer.concat f.time_zone_select(:time_zone)
1202 1202
     end
1203 1203
     
1204 1204
     assert_dom_equal(
@@ -1209,7 +1209,7 @@ def test_time_zone_select_under_fields_for
1209 1209
       "<option value=\"D\" selected=\"selected\">D</option>\n" +
1210 1210
       "<option value=\"E\">E</option>" +
1211 1211
       "</select>",
1212  
-      _erbout
  1212
+      @output_buffer
1213 1213
     )
1214 1214
   end
1215 1215
 
30  actionpack/test/template/form_tag_helper_test.rb
@@ -43,19 +43,19 @@ def test_form_tag_with_method_delete
43 43
   end
44 44
 
45 45
   def test_form_tag_with_block
46  
-    _erbout = ''
47  
-    form_tag("http://example.com") { _erbout.concat "Hello world!" }
  46
+    @output_buffer = ''
  47
+    form_tag("http://example.com") { @output_buffer.concat "Hello world!" }
48 48
 
49 49
     expected = %(<form action="http://example.com" method="post">Hello world!</form>)
50  
-    assert_dom_equal expected, _erbout
  50
+    assert_dom_equal expected, @output_buffer
51 51
   end
52 52
 
53 53
   def test_form_tag_with_block_and_method
54  
-    _erbout = ''
55  
-    form_tag("http://example.com", :method => :put) { _erbout.concat "Hello world!" }
  54
+    @output_buffer = ''
  55
+    form_tag("http://example.com", :method => :put) { @output_buffer.concat "Hello world!" }
56 56
 
57 57
     expected = %(<form action="http://example.com" method="post"><div style='margin:0;padding:0'><input type="hidden" name="_method" value="put" /></div>Hello world!</form>)
58  
-    assert_dom_equal expected, _erbout
  58
+    assert_dom_equal expected, @output_buffer
59 59
   end
60 60
 
61 61
   def test_hidden_field_tag
@@ -234,23 +234,23 @@ def test_pass
234 234
   end
235 235
 
236 236
   def test_field_set_tag
237  
-    _erbout = ''
238  
-    field_set_tag("Your details") { _erbout.concat "Hello world!" }
  237
+    @output_buffer = ''
  238
+    field_set_tag("Your details") { @output_buffer.concat "Hello world!" }
239 239
 
240 240
     expected = %(<fieldset><legend>Your details</legend>Hello world!</fieldset>)
241  
-    assert_dom_equal expected, _erbout
  241
+    assert_dom_equal expected, @output_buffer
242 242
 
243  
-    _erbout = ''
244  
-    field_set_tag { _erbout.concat "Hello world!" }
  243
+    @output_buffer = ''
  244
+    field_set_tag { @output_buffer.concat "Hello world!" }
245 245
 
246 246
     expected = %(<fieldset>Hello world!</fieldset>)
247  
-    assert_dom_equal expected, _erbout
  247
+    assert_dom_equal expected, @output_buffer
248 248
     
249  
-    _erbout = ''
250  
-    field_set_tag('') { _erbout.concat "Hello world!" }
  249
+    @output_buffer = ''
  250
+    field_set_tag('') { @output_buffer.concat "Hello world!" }
251 251
 
252 252
     expected = %(<fieldset>Hello world!</fieldset>)
253  
-    assert_dom_equal expected, _erbout
  253
+    assert_dom_equal expected, @output_buffer
254 254
   end
255 255
 
256 256
   def protect_against_forgery?
12  actionpack/test/template/javascript_helper_test.rb
@@ -92,15 +92,15 @@ def test_javascript_tag_with_options
92 92
   end
93 93
 
94 94
   def test_javascript_tag_with_block
95  
-    _erbout = ''
96  
-    javascript_tag { _erbout.concat "alert('hello')" }
97  
-    assert_dom_equal "<script type=\"text/javascript\">\n//<![CDATA[\nalert('hello')\n//]]>\n</script>", _erbout
  95
+    @output_buffer = ''
  96
+    javascript_tag { @output_buffer.concat "alert('hello')" }
  97
+    assert_dom_equal "<script type=\"text/javascript\">\n//<![CDATA[\nalert('hello')\n//]]>\n</script>", @output_buffer
98 98
   end
99 99
 
100 100
   def test_javascript_tag_with_block_and_options
101  
-    _erbout = ''
102  
-    javascript_tag(:id => "the_js_tag") { _erbout.concat "alert('hello')" }
103  
-    assert_dom_equal "<script id=\"the_js_tag\" type=\"text/javascript\">\n//<![CDATA[\nalert('hello')\n//]]>\n</script>", _erbout
  101
+    @output_buffer = ''
  102
+    javascript_tag(:id => "the_js_tag") { @output_buffer.concat "alert('hello')" }
  103
+    assert_dom_equal "<script id=\"the_js_tag\" type=\"text/javascript\">\n//<![CDATA[\nalert('hello')\n//]]>\n</script>", @output_buffer
104 104
   end
105 105
 
106 106
   def test_javascript_cdata_section
26  actionpack/test/template/prototype_helper_test.rb
@@ -118,52 +118,52 @@ def test_form_remote_tag_with_method
118 118
   end
119 119
 
120 120
   def test_form_remote_tag_with_block
121  
-    _erbout = ''
122  
-    form_remote_tag(:update => "glass_of_beer", :url => { :action => :fast  }) { _erbout.concat "Hello world!" }
123  
-    assert_dom_equal %(<form action=\"http://www.example.com/fast\" method=\"post\" onsubmit=\"new Ajax.Updater('glass_of_beer', 'http://www.example.com/fast', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;\">Hello world!</form>), _erbout
  121
+    @output_buffer = ''
  122
+    form_remote_tag(:update => "glass_of_beer", :url => { :action => :fast  }) { @output_buffer.concat "Hello world!" }
  123
+    assert_dom_equal %(<form action=\"http://www.example.com/fast\" method=\"post\" onsubmit=\"new Ajax.Updater('glass_of_beer', 'http://www.example.com/fast', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;\">Hello world!</form>), @output_buffer
124 124
   end
125 125
 
126 126
   def test_remote_form_for_with_record_identification_with_new_record
127  
-    _erbout = ''
  127
+    @output_buffer = ''
128 128
     remote_form_for(@record, {:html => { :id => 'create-author' }}) {}
129 129
     
130 130
     expected = %(<form action='#{authors_path}' onsubmit="new Ajax.Request('#{authors_path}', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;" class='new_author' id='create-author' method='post'></form>)
131  
-    assert_dom_equal expected, _erbout
  131
+    assert_dom_equal expected, @output_buffer
132 132
   end
133 133
 
134 134
   def test_remote_form_for_with_record_identification_without_html_options
135  
-    _erbout = ''
  135
+    @output_buffer = ''
136 136
     remote_form_for(@record) {}
137 137
     
138 138
     expected = %(<form action='#{authors_path}' onsubmit="new Ajax.Request('#{authors_path}', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;" class='new_author' method='post' id='new_author'></form>)
139  
-    assert_dom_equal expected, _erbout
  139
+    assert_dom_equal expected, @output_buffer
140 140
   end
141 141
 
142 142
   def test_remote_form_for_with_record_identification_with_existing_record
143 143
     @record.save
144  
-    _erbout = ''
  144
+    @output_buffer = ''
145 145
     remote_form_for(@record) {}
146 146
     
147 147
     expected = %(<form action='#{author_path(@record)}' id='edit_author_1' method='post' onsubmit="new Ajax.Request('#{author_path(@record)}', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;" class='edit_author'><div style='margin:0;padding:0'><input name='_method' type='hidden' value='put' /></div></form>)
148  
-    assert_dom_equal expected, _erbout
  148
+    assert_dom_equal expected, @output_buffer
149 149
   end
150 150
 
151 151
   def test_remote_form_for_with_new_object_in_list
152  
-    _erbout = ''
  152
+    @output_buffer = ''
153 153
     remote_form_for([@author, @article]) {}
154 154
     
155 155
     expected = %(<form action='#{author_articles_path(@author)}' onsubmit="new Ajax.Request('#{author_articles_path(@author)}', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;" class='new_article' method='post' id='new_article'></form>)
156  
-    assert_dom_equal expected, _erbout
  156
+    assert_dom_equal expected, @output_buffer
157 157
   end
158 158
   
159 159
   def test_remote_form_for_with_existing_object_in_list
160 160
     @author.save
161 161
     @article.save
162  
-    _erbout = ''
  162
+    @output_buffer = ''
163 163
     remote_form_for([@author, @article]) {}
164 164
     
165 165
     expected = %(<form action='#{author_article_path(@author, @article)}' id='edit_article_1' method='post' onsubmit="new Ajax.Request('#{author_article_path(@author, @article)}', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;" class='edit_article'><div style='margin:0;padding:0'><input name='_method' type='hidden' value='put' /></div></form>)
166  
-    assert_dom_equal expected, _erbout
  166
+    assert_dom_equal expected, @output_buffer
167 167
   end
168 168
 
169 169
   def test_on_callbacks
14  actionpack/test/template/record_tag_helper_test.rb
@@ -17,37 +17,37 @@ def setup
17 17
   end
18 18
   
19 19
   def test_content_tag_for
20  
-    _erbout = ''
  20
+    @output_buffer = ''
21 21
     expected = %(<li class="post bar" id="post_45"></li>)
22 22
     actual = content_tag_for(:li, @post, :class => 'bar') { }
23 23
     assert_dom_equal expected, actual
24 24
   end
25 25
   
26 26
   def test_content_tag_for_prefix
27  
-    _erbout = ''
  27
+    @output_buffer = ''
28 28
     expected = %(<ul class="post" id="archived_post_45"></ul>)
29 29
     actual = content_tag_for(:ul, @post, :archived) { }
30 30
     assert_dom_equal expected, actual    
31 31
   end
32 32
   
33 33
   def test_content_tag_for_with_extra_html_tags
34  
-    _erbout = ''
  34
+    @output_buffer = ''
35 35
     expected = %(<tr class="post bar" id="post_45" style='background-color: #f0f0f0'></tr>)
36 36
     actual = content_tag_for(:tr, @post, {:class => "bar", :style => "background-color: #f0f0f0"}) { }
37 37
     assert_dom_equal expected, actual        
38 38
   end
39 39
   
40 40
   def test_block_works_with_content_tag_for
41  
-    _erbout = ''
  41
+    @output_buffer = ''
42 42
     expected = %(<tr class="post" id="post_45">#{@post.body}</tr>)
43  
-    actual = content_tag_for(:tr, @post) { _erbout.concat @post.body }
  43
+    actual = content_tag_for(:tr, @post) { @output_buffer.concat @post.body }
44 44
     assert_dom_equal expected, actual            
45 45
   end
46 46
   
47 47
   def test_div_for    
48  
-    _erbout = ''    
  48
+    @output_buffer = ''
49 49
     expected = %(<div class="post bar" id="post_45">#{@post.body}</div>)
50  
-    actual = div_for(@post, :class => "bar") { _erbout.concat @post.body }
  50
+    actual = div_for(@post, :class => "bar") { @output_buffer.concat @post.body }
51 51
     assert_dom_equal expected, actual
52 52
   end  
53 53