2009-03-13 05:36:00 -04:00
|
|
|
require 'abstract_unit'
|
|
|
|
|
2009-03-16 15:09:34 -04:00
|
|
|
class BodyPartsTest < ActionController::TestCase
|
|
|
|
RENDERINGS = [Object.new, Object.new, Object.new]
|
2009-03-13 05:36:00 -04:00
|
|
|
|
|
|
|
class TestController < ActionController::Base
|
2009-08-09 02:05:04 -04:00
|
|
|
def response_body() "" end
|
2009-06-17 19:51:51 -04:00
|
|
|
|
2009-03-13 05:36:00 -04:00
|
|
|
def index
|
2009-03-13 21:49:53 -04:00
|
|
|
RENDERINGS.each do |rendering|
|
2010-03-17 19:28:05 -04:00
|
|
|
view_context.punctuate_body! rendering
|
2009-03-13 21:49:53 -04:00
|
|
|
end
|
2009-03-13 05:36:00 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
tests TestController
|
|
|
|
|
2009-03-16 15:09:34 -04:00
|
|
|
def test_body_parts
|
2009-03-13 05:36:00 -04:00
|
|
|
get :index
|
2009-06-17 19:51:51 -04:00
|
|
|
# TestProcess buffers body_parts into body
|
|
|
|
# TODO: Rewrite test w/o going through process
|
|
|
|
assert_equal RENDERINGS, @response.body_parts
|
2009-03-16 15:09:34 -04:00
|
|
|
assert_equal RENDERINGS.join, @response.body
|
2009-03-13 05:36:00 -04:00
|
|
|
end
|
|
|
|
end
|