1 require File.dirname(__FILE__) + '/../abstract_unit'
3 class CaptureController < ActionController::Base
4 def self.controller_name; "test"; end
5 def self.controller_path; "test"; end
8 render :layout => "talk_from_action"
12 render :layout => "talk_from_action"
16 render :layout => "talk_from_action"
19 def non_erb_block_content_for
20 render :layout => "talk_from_action"
23 def rescue_action(e) raise end
26 CaptureController.view_paths = [ File.dirname(__FILE__) + "/../fixtures/" ]
28 class CaptureTest < Test::Unit::TestCase
30 @controller = CaptureController.new
32 # enable a logger so that (e.g.) the benchmarking stuff runs, so we can get
33 # a more accurate simulation of what happens in "real life".
34 @controller.logger = Logger.new(nil)
36 @request = ActionController::TestRequest.new
37 @response = ActionController::TestResponse.new
39 @request.host = "www.nextangle.com"
42 def test_simple_capture
44 assert_equal "Dreamy days", @response.body.strip
49 assert_equal expected_content_for_output, @response.body
52 def test_erb_content_for
54 assert_equal expected_content_for_output, @response.body
57 def test_block_content_for
58 get :block_content_for
59 assert_equal expected_content_for_output, @response.body
62 def test_non_erb_block_content_for
63 get :non_erb_block_content_for
64 assert_equal expected_content_for_output, @response.body
68 def expected_content_for_output
69 "<title>Putting stuff in the title!</title>\n\nGreat stuff!"