aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-07-20 06:30:19 -0700
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-07-20 06:30:19 -0700
commitf3e4d2097d5f2218e86afd8acf1a3b0574798018 (patch)
tree8f139a46e8a423ddb0f2b5d3431cb340ea357fac /actionpack/test
parente1cfa6e0705f37b5f8cb885380f3a47405c24a9d (diff)
parent35fe3107a39271c9694e5094c1352c30463582e4 (diff)
downloadrails-f3e4d2097d5f2218e86afd8acf1a3b0574798018.tar.gz
rails-f3e4d2097d5f2218e86afd8acf1a3b0574798018.tar.bz2
rails-f3e4d2097d5f2218e86afd8acf1a3b0574798018.zip
Merge pull request #7099 from f1sherman/sweeper-clean-up-if-exception-raised
Clean up Sweeper controller accessor when an Error is raised
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/filters_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/test/controller/filters_test.rb b/actionpack/test/controller/filters_test.rb
index b9cb93f0f4..afc00a3c9d 100644
--- a/actionpack/test/controller/filters_test.rb
+++ b/actionpack/test/controller/filters_test.rb
@@ -505,6 +505,10 @@ class FilterTest < ActionController::TestCase
def show
render :text => 'hello world'
end
+
+ def error
+ raise StandardError.new
+ end
end
class ImplicitActionsController < ActionController::Base
@@ -534,6 +538,13 @@ class FilterTest < ActionController::TestCase
assert_equal 'hello world', response.body
end
+ def test_sweeper_should_clean_up_if_exception_is_raised
+ assert_raise StandardError do
+ test_process(SweeperTestController, 'error')
+ end
+ assert_nil AppSweeper.instance.controller
+ end
+
def test_before_method_of_sweeper_should_always_return_true
sweeper = ActionController::Caching::Sweeper.send(:new)
assert sweeper.before(TestController.new)