1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Support OPTIONS verb in route conditions [#1727 state:resolved]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
This commit is contained in:
Mike Gunderloy 2009-03-08 07:31:27 -05:00 committed by Pratik Naik
parent 5c87e9addd
commit 5e0f6214d2
2 changed files with 9 additions and 1 deletions

View file

@ -267,7 +267,7 @@ module ActionController
module Routing
SEPARATORS = %w( / . ? )
HTTP_METHODS = [:get, :head, :post, :put, :delete]
HTTP_METHODS = [:get, :head, :post, :put, :delete, :options]
ALLOWED_REQUIREMENTS_FOR_OPTIMISATION = [:controller, :action].to_set

View file

@ -1865,6 +1865,14 @@ class RouteSetTest < Test::Unit::TestCase
end
end
def test_route_requirements_with_options_method_condition_is_valid
assert_nothing_raised do
set.draw do |map|
map.connect 'valid/route', :controller => 'pages', :action => 'show', :conditions => {:method => :options}
end
end
end
def test_route_requirements_with_head_method_condition_is_invalid
assert_raises ArgumentError do
set.draw do |map|