mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
00a9d4b91c
Conflicts: actionpack/lib/action_controller/abstract/callbacks.rb actionpack/lib/action_controller/abstract/renderer.rb actionpack/lib/action_controller/base/base.rb actionpack/lib/action_controller/dispatch/dispatcher.rb actionpack/lib/action_controller/routing/route_set.rb actionpack/lib/action_controller/testing/process.rb actionpack/test/abstract_controller/layouts_test.rb actionpack/test/controller/filters_test.rb actionpack/test/controller/helper_test.rb actionpack/test/controller/render_test.rb actionpack/test/new_base/test_helper.rb
41 lines
1.4 KiB
Ruby
41 lines
1.4 KiB
Ruby
require 'abstract_unit'
|
|
|
|
class OutputBufferTest < ActionController::TestCase
|
|
class TestController < ActionController::Base
|
|
def index
|
|
render :text => 'foo'
|
|
end
|
|
end
|
|
|
|
tests TestController
|
|
|
|
def test_flush_output_buffer
|
|
pending
|
|
# TODO: This tests needs to be rewritten due
|
|
# The @response is not the same response object assigned
|
|
# to the @controller.template
|
|
|
|
# Start with the default body parts
|
|
# ---
|
|
# get :index
|
|
# assert_equal ['foo'], @response.body_parts
|
|
# assert_nil @controller.template.output_buffer
|
|
#
|
|
# # Nil output buffer is skipped
|
|
# @controller.template.flush_output_buffer
|
|
# assert_nil @controller.template.output_buffer
|
|
# assert_equal ['foo'], @response.body_parts
|
|
#
|
|
# # Empty output buffer is skipped
|
|
# @controller.template.output_buffer = ''
|
|
# @controller.template.flush_output_buffer
|
|
# assert_equal '', @controller.template.output_buffer
|
|
# assert_equal ['foo'], @response.body_parts
|
|
#
|
|
# # Flushing appends the output buffer to the body parts
|
|
# @controller.template.output_buffer = 'bar'
|
|
# @controller.template.flush_output_buffer
|
|
# assert_equal '', @controller.template.output_buffer
|
|
# assert_equal ['foo', 'bar'], @response.body_parts
|
|
end
|
|
end
|