Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add a test for missing "via" parameter

  • Loading branch information...
commit 57d0da86b4ee35c254dce3b7ea926b09871e517b 1 parent c91648b
Aaron Patterson tenderlove authored
2  actionpack/lib/action_dispatch/routing/mapper.rb
View
@@ -221,7 +221,7 @@ def normalize_conditions!(path_params, path, ast)
"If you want to expose your action to GET, use `get` in the router:\n" \
" Instead of: match \"controller#action\"\n" \
" Do: get \"controller#action\""
- raise msg
+ raise ArgumentError, msg
end
if via = options[:via]
8 actionpack/test/dispatch/routing_test.rb
View
@@ -2242,6 +2242,14 @@ def test_non_greedy_regexp
assert_equal '/api/1.0/users/first.last.xml', api_user_path(:version => '1.0', :id => 'first.last', :format => :xml)
end
+ def test_match_without_via
+ assert_raises(ArgumentError) do
+ draw do
+ match '/foo/bar', :to => 'files#show'
+ end
+ end
+ end
+
def test_glob_parameter_accepts_regexp
draw do
get '/:locale/*file.:format', :to => 'files#show', :file => /path\/to\/existing\/file/
Please sign in to comment.
Something went wrong with that request. Please try again.