Changeset 4954
- Timestamp:
- 09/03/06 23:34:57 (2 years ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_controller/integration.rb (modified) (1 diff)
- trunk/actionpack/test/controller/base_test.rb (modified) (1 diff)
- trunk/actionpack/test/controller/integration_test.rb (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r4953 r4954 1 1 *SVN* 2 3 * Integration tests: thoroughly test ActionController::Integration::Session. #6022 [Kevin Clark] 4 (tests skipped unless you `gem install mocha`) 2 5 3 6 * Added deprecation language for pagination which will become a plugin by Rails 2.0 [DHH] trunk/actionpack/lib/action_controller/integration.rb
r4952 r4954 152 152 end 153 153 154 # keep the docs for #get 155 %w( post put delete head ).each do |method| 156 class_eval <<-EOV, __FILE__, __LINE__ 157 def #{method}(path, parameters=nil, headers=nil) 158 process :#{method}, path, parameters, headers 159 end 160 EOV 154 # Performs a POST request with the given parameters. See get() for more details. 155 def post(path, parameters=nil, headers=nil) 156 process :post, path, parameters, headers 157 end 158 159 # Performs a PUT request with the given parameters. See get() for more details. 160 def put(path, parameters=nil, headers=nil) 161 process :put, path, parameters, headers 162 end 163 164 # Performs a DELETE request with the given parameters. See get() for more details. 165 def delete(path, parameters=nil, headers=nil) 166 process :delete, path, parameters, headers 167 end 168 169 # Performs a HEAD request with the given parameters. See get() for more details. 170 def head(path, parameters=nil, headers=nil) 171 process :head, path, parameters, headers 161 172 end 162 173 trunk/actionpack/test/controller/base_test.rb
r4755 r4954 75 75 def test_action_methods 76 76 @empty_controllers.each do |c| 77 hide_mocha_methods_from_controller(c) 77 78 assert_equal Set.new, c.send(:action_methods), "#{c.controller_path} should be empty!" 78 79 end 79 80 @non_empty_controllers.each do |c| 81 hide_mocha_methods_from_controller(c) 80 82 assert_equal Set.new('public_action'), c.send(:action_methods), "#{c.controller_path} should not be empty!" 81 83 end 84 end 85 86 protected 87 88 # Mocha adds methods to Object which are then included in the public_instance_methods 89 # This method hides those from the controller so the above tests won't know the difference 90 def hide_mocha_methods_from_controller(controller) 91 mocha_methods = [:expects, :metaclass, :mocha, :mocha_inspect, :reset_mocha, :stubba_object, :stubba_method, :stubs, :verify] 92 controller.class.send(:hide_action, *mocha_methods) 82 93 end 83 94