diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2013-06-20 15:42:49 -0700 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2013-06-20 15:42:49 -0700 |
commit | a29f746398e7b0647885343e7f26d977dd251999 (patch) | |
tree | 1e2cd2ee1f8f31812c0acf71350ffe423ca8c5a9 /actionpack/test/template/output_buffer_test.rb | |
parent | 7c69a829a311a31109939cff19b700b36b97d5c4 (diff) | |
parent | d6b1caa8f2011487c08b414605883f1f220d0aaa (diff) | |
download | rails-a29f746398e7b0647885343e7f26d977dd251999.tar.gz rails-a29f746398e7b0647885343e7f26d977dd251999.tar.bz2 rails-a29f746398e7b0647885343e7f26d977dd251999.zip |
Merge pull request #11032 from strzalek/extract-actionview
Extract ActionView to separate directory
Diffstat (limited to 'actionpack/test/template/output_buffer_test.rb')
-rw-r--r-- | actionpack/test/template/output_buffer_test.rb | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/actionpack/test/template/output_buffer_test.rb b/actionpack/test/template/output_buffer_test.rb deleted file mode 100644 index eb0df3d1ab..0000000000 --- a/actionpack/test/template/output_buffer_test.rb +++ /dev/null @@ -1,59 +0,0 @@ -require 'abstract_unit' - -class OutputBufferTest < ActionController::TestCase - class TestController < ActionController::Base - def index - render :text => 'foo' - end - end - - tests TestController - - def setup - @vc = @controller.view_context - get :index - assert_equal ['foo'], body_parts - end - - test 'output buffer is nil after rendering' do - assert_nil output_buffer - end - - test 'flushing ignores nil output buffer' do - @controller.view_context.flush_output_buffer - assert_nil output_buffer - assert_equal ['foo'], body_parts - end - - test 'flushing ignores empty output buffer' do - @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 - @vc.output_buffer = 'bar' - @vc.flush_output_buffer - assert_equal '', output_buffer - assert_equal ['foo', 'bar'], body_parts - end - - test 'flushing preserves output buffer encoding' do - original_buffer = ' '.force_encoding(Encoding::EUC_JP) - @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 - end - - protected - def output_buffer - @vc.output_buffer - end - - def body_parts - @controller.response.body_parts - end -end |