Browse files

fix request methods test

  • Loading branch information...
1 parent 3b0b573 commit d0b8f4c309beb009bfc4538a85ee17feb9b34436 @vipulnsward vipulnsward committed Mar 31, 2013
Showing with 2 additions and 6 deletions.
  1. +2 −6 actionpack/test/controller/routing_test.rb
View
8 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 d0b8f4c

Please sign in to comment.