diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-03-16 12:09:34 -0700 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-03-16 12:09:34 -0700 |
commit | 70e3dfb2e9f94396eb6525d13f9adccd3e845c3d (patch) | |
tree | cc52e80f9b8e6f758077b99deee279775d76f6c9 | |
parent | 4a7b11d5d857a0f5ce6eb8af7a6dfcb94f31fcfa (diff) | |
download | rails-70e3dfb2e9f94396eb6525d13f9adccd3e845c3d.tar.gz rails-70e3dfb2e9f94396eb6525d13f9adccd3e845c3d.tar.bz2 rails-70e3dfb2e9f94396eb6525d13f9adccd3e845c3d.zip |
Pare down unit test
-rw-r--r-- | actionpack/test/template/body_parts_test.rb | 42 |
1 files changed, 6 insertions, 36 deletions
diff --git a/actionpack/test/template/body_parts_test.rb b/actionpack/test/template/body_parts_test.rb index 369756cbf5..209f6ec1ff 100644 --- a/actionpack/test/template/body_parts_test.rb +++ b/actionpack/test/template/body_parts_test.rb @@ -1,57 +1,27 @@ require 'abstract_unit' require 'action_view/body_parts/concurrent_block' -class BodyPartTest < ActionController::TestCase - module EdgeSideInclude - QUEUE_REDEMPTION_URL = 'http://render.farm/renderings/%s' - ESI_INCLUDE_TAG = '<esi:include src="%s" />' - - def self.redemption_tag(receipt) - ESI_INCLUDE_TAG % QUEUE_REDEMPTION_URL % receipt - end - - class BodyPart - def initialize(rendering) - @receipt = enqueue(rendering) - end - - def to_s - EdgeSideInclude.redemption_tag(@receipt) - end - - protected - # Pretend we sent this rendering off for processing. - def enqueue(rendering) - rendering.object_id.to_s - end - end - end +class BodyPartsTest < ActionController::TestCase + RENDERINGS = [Object.new, Object.new, Object.new] class TestController < ActionController::Base - RENDERINGS = [Object.new, Object.new, Object.new] - def index RENDERINGS.each do |rendering| - edge_side_include rendering + response.template.punctuate_body! rendering end @performed_render = true end - - def edge_side_include(rendering) - response.template.punctuate_body! EdgeSideInclude::BodyPart.new(rendering) - end end tests TestController - def test_queued_parts + def test_body_parts get :index - expected = TestController::RENDERINGS.map { |rendering| EdgeSideInclude.redemption_tag(rendering.object_id) }.join - assert_equal expected, @response.body + assert_equal RENDERINGS, @response.body_parts + assert_equal RENDERINGS.join, @response.body end end - class ConcurrentBlockPartTest < ActionController::TestCase class TestController < ActionController::Base def index |