diff options
author | wycats <wycats@gmail.com> | 2010-03-26 15:10:24 -0700 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2010-03-26 15:10:24 -0700 |
commit | 197904341f2b2f21d69c653cede3aec124e86720 (patch) | |
tree | 83f1234e238016126860a929594db22e1862d783 /actionpack/test/template/output_buffer_test.rb | |
parent | 76d2c455c0607b4cd5f238cadef8f933a18567fb (diff) | |
parent | b3a0aed028835ce4551c4a76742744a40a71b0be (diff) | |
download | rails-197904341f2b2f21d69c653cede3aec124e86720.tar.gz rails-197904341f2b2f21d69c653cede3aec124e86720.tar.bz2 rails-197904341f2b2f21d69c653cede3aec124e86720.zip |
Merge branch 'master' into docrails
Diffstat (limited to 'actionpack/test/template/output_buffer_test.rb')
-rw-r--r-- | actionpack/test/template/output_buffer_test.rb | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/actionpack/test/template/output_buffer_test.rb b/actionpack/test/template/output_buffer_test.rb index 36bbaf9099..bd49a11af1 100644 --- a/actionpack/test/template/output_buffer_test.rb +++ b/actionpack/test/template/output_buffer_test.rb @@ -10,6 +10,7 @@ class OutputBufferTest < ActionController::TestCase tests TestController def setup + @vc = @controller.view_context get :index assert_equal ['foo'], body_parts end @@ -19,21 +20,21 @@ class OutputBufferTest < ActionController::TestCase end test 'flushing ignores nil output buffer' do - @controller.template.flush_output_buffer + @controller.view_context.flush_output_buffer assert_nil output_buffer assert_equal ['foo'], body_parts end test 'flushing ignores empty output buffer' do - @controller.template.output_buffer = '' - @controller.template.flush_output_buffer + @vc.output_buffer = '' + @vc.flush_output_buffer assert_equal '', output_buffer assert_equal ['foo'], body_parts end test 'flushing appends the output buffer to the body parts' do - @controller.template.output_buffer = 'bar' - @controller.template.flush_output_buffer + @vc.output_buffer = 'bar' + @vc.flush_output_buffer assert_equal '', output_buffer assert_equal ['foo', 'bar'], body_parts end @@ -41,8 +42,8 @@ class OutputBufferTest < ActionController::TestCase if '1.9'.respond_to?(:force_encoding) test 'flushing preserves output buffer encoding' do original_buffer = ' '.force_encoding(Encoding::EUC_JP) - @controller.template.output_buffer = original_buffer - @controller.template.flush_output_buffer + @vc.output_buffer = original_buffer + @vc.flush_output_buffer assert_equal ['foo', original_buffer], body_parts assert_not_equal original_buffer, output_buffer assert_equal Encoding::EUC_JP, output_buffer.encoding @@ -51,10 +52,10 @@ class OutputBufferTest < ActionController::TestCase protected def output_buffer - @controller.template.output_buffer + @vc.output_buffer end def body_parts - @controller.template.response.body_parts + @controller.response.body_parts end end |