diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-28 15:14:37 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2014-05-28 15:14:49 -0700 |
commit | 5bbab5110b141df0f856221a59a6f4ad1ea7c88c (patch) | |
tree | ec5931c1cc580888bde94544fb6f0afa32a008f9 /actionpack/test/dispatch | |
parent | d49e1c75520857a9ea8b2c7448300ad4a8e2095f (diff) | |
download | rails-5bbab5110b141df0f856221a59a6f4ad1ea7c88c.tar.gz rails-5bbab5110b141df0f856221a59a6f4ad1ea7c88c.tar.bz2 rails-5bbab5110b141df0f856221a59a6f4ad1ea7c88c.zip |
add tests for argument error cases
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r-- | actionpack/test/dispatch/routing_test.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index a427113763..c9777ae71f 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -3478,6 +3478,33 @@ class TestNamespaceWithControllerOption < ActionDispatch::IntegrationTest @app.draw(&block) end + def test_missing_controller + ex = assert_raises(ArgumentError) { + draw do + get '/foo/bar', :to => :index + end + } + assert_match(/Missing :controller/, ex.message) + end + + def test_missing_action + ex = assert_raises(ArgumentError) { + draw do + get '/foo/bar', :to => 'foo' + end + } + assert_match(/Missing :action/, ex.message) + end + + def test_missing_action_on_hash + ex = assert_raises(ArgumentError) { + draw do + get '/foo/bar', :to => 'foo#' + end + } + assert_match(/Missing :action/, ex.message) + end + def test_valid_controller_options_inside_namespace draw do namespace :admin do |