Permalink
Browse files

add a test for missing "via" parameter

  • Loading branch information...
1 parent c91648b commit 57d0da86b4ee35c254dce3b7ea926b09871e517b @tenderlove tenderlove committed May 30, 2014
Showing with 9 additions and 1 deletion.
  1. +1 −1 actionpack/lib/action_dispatch/routing/mapper.rb
  2. +8 −0 actionpack/test/dispatch/routing_test.rb
@@ -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]
@@ -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/

0 comments on commit 57d0da8

Please sign in to comment.