rails--rails/actionpack/test/template/body_parts_test.rb

27 lines
626 B
Ruby
Raw Normal View History

require 'abstract_unit'
2009-03-16 19:09:34 +00:00
class BodyPartsTest < ActionController::TestCase
RENDERINGS = [Object.new, Object.new, Object.new]
class TestController < ActionController::Base
def response_body() "" end
def index
2009-03-14 01:49:53 +00:00
RENDERINGS.each do |rendering|
@template.punctuate_body! rendering
2009-03-14 01:49:53 +00:00
end
@performed_render = true
end
end
tests TestController
2009-03-16 19:09:34 +00:00
def test_body_parts
get :index
# TestProcess buffers body_parts into body
# TODO: Rewrite test w/o going through process
assert_equal RENDERINGS, @response.body_parts
2009-03-16 19:09:34 +00:00
assert_equal RENDERINGS.join, @response.body
end
end