aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/new_render_test.rb
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2005-05-30 09:00:46 +0000
committerJamis Buck <jamis@37signals.com>2005-05-30 09:00:46 +0000
commitf8542a64b30bb6f67bcedf0c82de1291aab3c3d9 (patch)
tree375ae117198ca6f03526a0cbfcfc9f1729bf6027 /actionpack/test/controller/new_render_test.rb
parentf57ee365e154ce6d15cd168112d94a9a8ff27094 (diff)
downloadrails-f8542a64b30bb6f67bcedf0c82de1291aab3c3d9.tar.gz
rails-f8542a64b30bb6f67bcedf0c82de1291aab3c3d9.tar.bz2
rails-f8542a64b30bb6f67bcedf0c82de1291aab3c3d9.zip
Make sure the benchmarking render method always returns the result of the render, regardless of whether logging is enabled or not.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1371 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller/new_render_test.rb')
-rw-r--r--actionpack/test/controller/new_render_test.rb34
1 files changed, 11 insertions, 23 deletions
diff --git a/actionpack/test/controller/new_render_test.rb b/actionpack/test/controller/new_render_test.rb
index 3d1e6e794b..fb23b9e02c 100644
--- a/actionpack/test/controller/new_render_test.rb
+++ b/actionpack/test/controller/new_render_test.rb
@@ -9,10 +9,12 @@ module Fun
end
end
-
-class TestController < ActionController::Base
+class NewRenderTestController < ActionController::Base
layout :determine_layout
+ def self.controller_name; "test"; end
+ def self.controller_path; "test"; end
+
def hello_world
end
@@ -103,26 +105,17 @@ class TestController < ActionController::Base
end
end
-TestController.template_root = File.dirname(__FILE__) + "/../fixtures/"
+NewRenderTestController.template_root = File.dirname(__FILE__) + "/../fixtures/"
Fun::GamesController.template_root = File.dirname(__FILE__) + "/../fixtures/"
-class TestLayoutController < ActionController::Base
- layout "layouts/standard"
-
- def hello_world
- end
-
- def hello_world_outside_layout
- end
+class NewRenderTest < Test::Unit::TestCase
+ def setup
+ @controller = NewRenderTestController.new
- def rescue_action(e)
- raise unless ActionController::MissingTemplate === e
- end
-end
+ # enable a logger so that (e.g.) the benchmarking stuff runs, so we can get
+ # a more accurate simulation of what happens in "real life".
+ @controller.logger = Logger.new(nil)
-class RenderTest < Test::Unit::TestCase
- def setup
- @controller = TestController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
@@ -244,9 +237,4 @@ class RenderTest < Test::Unit::TestCase
get :accessing_params_in_template, :name => "David"
assert_equal "Hello: David", @response.body
end
-
- private
- def process_request
- TestController.process(@request, @response)
- end
end