diff options
author | Xavier Noria <fxn@hashref.com> | 2010-05-01 02:23:47 -0700 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-05-01 02:23:47 -0700 |
commit | efba1d4227514a6ce4880910a6531b0a6c3c75aa (patch) | |
tree | daff4155b8c19b915125ac0b0da458279358e743 /actionpack/test/dispatch/routing_test.rb | |
parent | 81807e0fe2879e08563c91ee6809ab6d1d0bd081 (diff) | |
parent | 6c280f3398966ffba45069500ff43d632513fe44 (diff) | |
download | rails-efba1d4227514a6ce4880910a6531b0a6c3c75aa.tar.gz rails-efba1d4227514a6ce4880910a6531b0a6c3c75aa.tar.bz2 rails-efba1d4227514a6ce4880910a6531b0a6c3c75aa.zip |
Merge commit 'rails/master'
Conflicts:
railties/guides/source/index.html.erb
Diffstat (limited to 'actionpack/test/dispatch/routing_test.rb')
-rw-r--r-- | actionpack/test/dispatch/routing_test.rb | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index b508996467..651a7a6be0 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -392,12 +392,14 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest get '/admin', {}, {'REMOTE_ADDR' => '192.168.1.100'} assert_equal 'queenbee#index', @response.body - assert_raise(ActionController::RoutingError) { get '/admin', {}, {'REMOTE_ADDR' => '10.0.0.100'} } + get '/admin', {}, {'REMOTE_ADDR' => '10.0.0.100'} + assert_equal 'pass', @response.headers['X-Cascade'] get '/admin/accounts', {}, {'REMOTE_ADDR' => '192.168.1.100'} assert_equal 'queenbee#accounts', @response.body - assert_raise(ActionController::RoutingError) { get '/admin/accounts', {}, {'REMOTE_ADDR' => '10.0.0.100'} } + get '/admin/accounts', {}, {'REMOTE_ADDR' => '10.0.0.100'} + assert_equal 'pass', @response.headers['X-Cascade'] end end @@ -648,10 +650,14 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest assert_equal 'comments#index', @response.body assert_equal '/posts/1/comments', post_comments_path(:post_id => 1) - assert_raise(ActionController::RoutingError) { post '/posts' } - assert_raise(ActionController::RoutingError) { put '/posts/1' } - assert_raise(ActionController::RoutingError) { delete '/posts/1' } - assert_raise(ActionController::RoutingError) { delete '/posts/1/comments' } + post '/posts' + assert_equal 'pass', @response.headers['X-Cascade'] + put '/posts/1' + assert_equal 'pass', @response.headers['X-Cascade'] + delete '/posts/1' + assert_equal 'pass', @response.headers['X-Cascade'] + delete '/posts/1/comments' + assert_equal 'pass', @response.headers['X-Cascade'] end end @@ -775,7 +781,8 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest get '/articles/rails/1' assert_equal 'articles#with_id', @response.body - assert_raise(ActionController::RoutingError) { get '/articles/123/1' } + get '/articles/123/1' + assert_equal 'pass', @response.headers['X-Cascade'] assert_equal '/articles/rails/1', article_with_title_path(:title => 'rails', :id => 1) end @@ -953,19 +960,22 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest def test_resource_constraints with_test_routes do - assert_raise(ActionController::RoutingError) { get '/products/1' } + get '/products/1' + assert_equal 'pass', @response.headers['X-Cascade'] get '/products' assert_equal 'products#index', @response.body get '/products/0001' assert_equal 'products#show', @response.body - assert_raise(ActionController::RoutingError) { get '/products/1/images' } + get '/products/1/images' + assert_equal 'pass', @response.headers['X-Cascade'] get '/products/0001/images' assert_equal 'images#index', @response.body get '/products/0001/images/1' assert_equal 'images#show', @response.body - assert_raise(ActionController::RoutingError) { get '/dashboard', {}, {'REMOTE_ADDR' => '10.0.0.100'} } + get '/dashboard', {}, {'REMOTE_ADDR' => '10.0.0.100'} + assert_equal 'pass', @response.headers['X-Cascade'] get '/dashboard', {}, {'REMOTE_ADDR' => '192.168.1.100'} assert_equal 'dashboards#show', @response.body end |