Permalink
Browse files

Merge pull request #10013 from vipulnsward/fix_request_method_test

fix request methods test
  • Loading branch information...
2 parents d535249 + d0b8f4c commit 31216ec84b6988683c0c60e1ff08163a75d27680 @spastorino spastorino committed Mar 31, 2013
Showing with 2 additions and 6 deletions.
  1. +2 −6 actionpack/test/controller/routing_test.rb
@@ -715,17 +715,13 @@ def test_nil_defaults
def setup_request_method_routes_for(method)
rs.draw do
- match '/match' => 'books#get', :via => :get
- match '/match' => 'books#post', :via => :post
- match '/match' => 'books#put', :via => :put
- match '/match' => 'books#patch', :via => :patch
- match '/match' => 'books#delete', :via => :delete
+ match '/match' => "books##{method}", :via => method.to_sym
end
end
%w(GET PATCH POST PUT DELETE).each do |request_method|
define_method("test_request_method_recognized_with_#{request_method}") do
- setup_request_method_routes_for(request_method)
+ setup_request_method_routes_for(request_method.downcase)
params = rs.recognize_path("/match", :method => request_method)
assert_equal request_method.downcase, params[:action]
end

0 comments on commit 31216ec

Please sign in to comment.