aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2012-04-05 06:20:02 -0700
committerJosé Valim <jose.valim@gmail.com>2012-04-05 06:20:02 -0700
commit91cb99e9e4ef1b543cf60c2e56cf3ea865a2ac76 (patch)
treef2fe92d1299fba495dc40c03633d33ab39894136
parentacae4fd4eda2209008527f2e554720f5cb874ac7 (diff)
parent2ac67358a3ce6bf528502dd4c141061d261c2ffb (diff)
downloadrails-91cb99e9e4ef1b543cf60c2e56cf3ea865a2ac76.tar.gz
rails-91cb99e9e4ef1b543cf60c2e56cf3ea865a2ac76.tar.bz2
rails-91cb99e9e4ef1b543cf60c2e56cf3ea865a2ac76.zip
Merge pull request #4446 from ayamomiji/patch-1
prevent the cache sweeper ignores NoMethodError
-rw-r--r--actionpack/lib/action_controller/caching/sweeping.rb2
-rw-r--r--actionpack/test/controller/filters_test.rb7
2 files changed, 8 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/caching/sweeping.rb b/actionpack/lib/action_controller/caching/sweeping.rb
index bb176ca3f9..cc1fa23935 100644
--- a/actionpack/lib/action_controller/caching/sweeping.rb
+++ b/actionpack/lib/action_controller/caching/sweeping.rb
@@ -93,7 +93,7 @@ module ActionController #:nodoc:
end
def method_missing(method, *arguments, &block)
- super unless @controller
+ return super unless @controller
@controller.__send__(method, *arguments, &block)
end
end
diff --git a/actionpack/test/controller/filters_test.rb b/actionpack/test/controller/filters_test.rb
index 65c853f6eb..ef7fbca675 100644
--- a/actionpack/test/controller/filters_test.rb
+++ b/actionpack/test/controller/filters_test.rb
@@ -510,6 +510,13 @@ class FilterTest < ActionController::TestCase
end
end
+ def test_sweeper_should_not_ignore_no_method_error
+ sweeper = ActionController::Caching::Sweeper.send(:new)
+ assert_raise NoMethodError do
+ sweeper.send_not_defined
+ end
+ end
+
def test_sweeper_should_not_block_rendering
response = test_process(SweeperTestController)
assert_equal 'hello world', response.body