aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-04-21 21:11:23 -0500
committerJoshua Peek <josh@joshpeek.com>2009-04-21 21:11:23 -0500
commit380431e4ed12d184c4e4891fbb74fdc38a51d2f2 (patch)
tree5c136e2770b03a0d389d7353db17039ad22d3e5a /actionpack/test/controller
parent0b92bb97c185f426585af770dcf43b67b0253f50 (diff)
downloadrails-380431e4ed12d184c4e4891fbb74fdc38a51d2f2.tar.gz
rails-380431e4ed12d184c4e4891fbb74fdc38a51d2f2.tar.bz2
rails-380431e4ed12d184c4e4891fbb74fdc38a51d2f2.zip
Fix test_rescue_routing_exceptions when running with rake
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/rescue_test.rb28
1 files changed, 15 insertions, 13 deletions
diff --git a/actionpack/test/controller/rescue_test.rb b/actionpack/test/controller/rescue_test.rb
index cc5a724081..894420a910 100644
--- a/actionpack/test/controller/rescue_test.rb
+++ b/actionpack/test/controller/rescue_test.rb
@@ -522,6 +522,12 @@ class ControllerInheritanceRescueControllerTest < ActionController::TestCase
end
end
+class ApplicationController < ActionController::Base
+ rescue_from ActionController::RoutingError do
+ render :text => 'no way'
+ end
+end
+
class RescueTest < ActionController::IntegrationTest
class TestController < ActionController::Base
class RecordInvalid < StandardError
@@ -549,16 +555,6 @@ class RescueTest < ActionController::IntegrationTest
end
end
- def setup
- ActionController::Base.rescue_from ActionController::RoutingError do
- render :text => 'no way'
- end
- end
-
- def teardown
- ActionController::Base.rescue_handlers.clear
- end
-
test 'normal request' do
with_test_routing do
get '/foo'
@@ -574,9 +570,15 @@ class RescueTest < ActionController::IntegrationTest
end
test 'rescue routing exceptions' do
- with_test_routing do
- get '/no_way'
- assert_equal 'no way', response.body
+ assert_equal 1, ApplicationController.rescue_handlers.length
+
+ begin
+ with_test_routing do
+ get '/no_way'
+ assert_equal 'no way', response.body
+ end
+ ensure
+ ActionController::Base.rescue_handlers.clear
end
end