aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLevente Bagi <levente@picklive.com>2012-03-06 16:24:04 +0000
committerLevente Bagi <levente@picklive.com>2012-03-06 16:24:04 +0000
commitb4b0fddb24b0e6cbff6936606689984274cecd15 (patch)
treef63b009a44c34e111b5842d9a7da8b4f4407de18
parentf0ad8532f3497110d590df42c573050944d41f92 (diff)
downloadrails-b4b0fddb24b0e6cbff6936606689984274cecd15.tar.gz
rails-b4b0fddb24b0e6cbff6936606689984274cecd15.tar.bz2
rails-b4b0fddb24b0e6cbff6936606689984274cecd15.zip
Don't ignore call to undefined method in Sweeper
-rw-r--r--actionpack/lib/action_controller/caching/sweeping.rb2
-rw-r--r--actionpack/test/controller/sweeper_test.rb16
2 files changed, 17 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/caching/sweeping.rb b/actionpack/lib/action_controller/caching/sweeping.rb
index 49cf70ec21..808a6fe5f3 100644
--- a/actionpack/lib/action_controller/caching/sweeping.rb
+++ b/actionpack/lib/action_controller/caching/sweeping.rb
@@ -88,7 +88,7 @@ module ActionController #:nodoc:
end
def method_missing(method, *arguments, &block)
- return unless @controller
+ super unless @controller
@controller.__send__(method, *arguments, &block)
end
end
diff --git a/actionpack/test/controller/sweeper_test.rb b/actionpack/test/controller/sweeper_test.rb
new file mode 100644
index 0000000000..0561efc62f
--- /dev/null
+++ b/actionpack/test/controller/sweeper_test.rb
@@ -0,0 +1,16 @@
+require 'abstract_unit'
+
+
+class SweeperTest < ActionController::TestCase
+
+ class ::AppSweeper < ActionController::Caching::Sweeper; end
+
+ def test_sweeper_should_not_ignore_unknown_method_calls
+ sweeper = ActionController::Caching::Sweeper.send(:new)
+ assert_raise NameError do
+ sweeper.instance_eval do
+ some_method_that_doesnt_exist
+ end
+ end
+ end
+end