aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/base_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-09-03 23:34:57 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-09-03 23:34:57 +0000
commit71dbef6d27210259ae263b84120f94fe9d6784e7 (patch)
treeb863ce62374da9be207a72d89ea53e378585b620 /actionpack/test/controller/base_test.rb
parent8ca3f34db18d23ff26ee71f11a2eba3dcfdff22f (diff)
downloadrails-71dbef6d27210259ae263b84120f94fe9d6784e7.tar.gz
rails-71dbef6d27210259ae263b84120f94fe9d6784e7.tar.bz2
rails-71dbef6d27210259ae263b84120f94fe9d6784e7.zip
Integration tests: thoroughly test ActionController::Integration::Session. Closes #6022.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4954 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/controller/base_test.rb')
-rw-r--r--actionpack/test/controller/base_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/actionpack/test/controller/base_test.rb b/actionpack/test/controller/base_test.rb
index 9cf035d1cb..bcc473263f 100644
--- a/actionpack/test/controller/base_test.rb
+++ b/actionpack/test/controller/base_test.rb
@@ -74,13 +74,24 @@ class ControllerInstanceTests < Test::Unit::TestCase
def test_action_methods
@empty_controllers.each do |c|
+ hide_mocha_methods_from_controller(c)
assert_equal Set.new, c.send(:action_methods), "#{c.controller_path} should be empty!"
end
@non_empty_controllers.each do |c|
+ hide_mocha_methods_from_controller(c)
assert_equal Set.new('public_action'), c.send(:action_methods), "#{c.controller_path} should not be empty!"
end
end
+ protected
+
+ # Mocha adds methods to Object which are then included in the public_instance_methods
+ # This method hides those from the controller so the above tests won't know the difference
+ def hide_mocha_methods_from_controller(controller)
+ mocha_methods = [:expects, :metaclass, :mocha, :mocha_inspect, :reset_mocha, :stubba_object, :stubba_method, :stubs, :verify]
+ controller.class.send(:hide_action, *mocha_methods)
+ end
+
end