aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch
diff options
context:
space:
mode:
authorwycats <wycats@gmail.com>2010-04-10 17:22:52 -0400
committerwycats <wycats@gmail.com>2010-04-10 17:22:52 -0400
commit87f7093ee3306f417e1136d947eba200d40ff8e7 (patch)
treeba70dbdaf67e12fc067bb5d8343d7681932452ef /actionpack/test/dispatch
parentee8e9d548472fb8cb8792a569e579c6513be77d6 (diff)
parent381f877bbbbf81d679f5be3b7ac7e961d41502bd (diff)
downloadrails-87f7093ee3306f417e1136d947eba200d40ff8e7.tar.gz
rails-87f7093ee3306f417e1136d947eba200d40ff8e7.tar.bz2
rails-87f7093ee3306f417e1136d947eba200d40ff8e7.zip
Merge branch 'master' into docrails_master
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r--actionpack/test/dispatch/routing_test.rb28
-rw-r--r--actionpack/test/dispatch/show_exceptions_test.rb9
2 files changed, 37 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb
index 6ff478aec1..d38c48bfd4 100644
--- a/actionpack/test/dispatch/routing_test.rb
+++ b/actionpack/test/dispatch/routing_test.rb
@@ -186,6 +186,15 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
end
resource :dashboard, :constraints => { :ip => /192\.168\.1\.\d{1,3}/ }
+
+ scope :module => 'api' do
+ resource :token
+ end
+
+ scope :path => 'api' do
+ resource :me
+ match '/' => 'mes#index'
+ end
end
end
@@ -942,6 +951,25 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
end
end
+ def test_module_scope
+ with_test_routes do
+ get '/token'
+ assert_equal 'api/tokens#show', @response.body
+ assert_equal '/token', token_path
+ end
+ end
+
+ def test_path_scope
+ with_test_routes do
+ get '/api/me'
+ assert_equal 'mes#show', @response.body
+ assert_equal '/api/me', me_path
+
+ get '/api'
+ assert_equal 'mes#index', @response.body
+ end
+ end
+
private
def with_test_routes
yield
diff --git a/actionpack/test/dispatch/show_exceptions_test.rb b/actionpack/test/dispatch/show_exceptions_test.rb
index 97da680f17..b447b0715c 100644
--- a/actionpack/test/dispatch/show_exceptions_test.rb
+++ b/actionpack/test/dispatch/show_exceptions_test.rb
@@ -106,4 +106,13 @@ class ShowExceptionsTest < ActionController::IntegrationTest
assert_response 405
assert_match /ActionController::MethodNotAllowed/, body
end
+
+ test "does not show filtered parameters" do
+ @app = DevelopmentApp
+
+ get "/", {"foo"=>"bar"}, {'action_dispatch.show_exceptions' => true,
+ 'action_dispatch.parameter_filter' => [:foo]}
+ assert_response 500
+ assert_match "&quot;foo&quot;=&gt;&quot;[FILTERED]&quot;", body
+ end
end