Skip to content

Commit

Permalink
fix request methods test
Browse files Browse the repository at this point in the history
  • Loading branch information
vipulnsward committed Mar 31, 2013
1 parent 3b0b573 commit d0b8f4c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions actionpack/test/controller/routing_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d0b8f4c

Please sign in to comment.