aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/routing_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/dispatch/routing_test.rb')
-rw-r--r--actionpack/test/dispatch/routing_test.rb31
1 files changed, 22 insertions, 9 deletions
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb
index 75fdc9469f..5298e63fef 100644
--- a/actionpack/test/dispatch/routing_test.rb
+++ b/actionpack/test/dispatch/routing_test.rb
@@ -373,6 +373,9 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
post "create", :as => ""
put "update"
get "remove", :action => :destroy, :as => :remove
+ tc.assert_deprecated do
+ get action: :show, as: :show
+ end
end
end
@@ -391,6 +394,10 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
get '/pagemark/remove'
assert_equal 'pagemarks#destroy', @response.body
assert_equal '/pagemark/remove', pagemark_remove_path
+
+ get '/pagemark'
+ assert_equal 'pagemarks#show', @response.body
+ assert_equal '/pagemark', pagemark_show_path
end
def test_admin
@@ -4324,15 +4331,16 @@ class TestInvalidUrls < ActionDispatch::IntegrationTest
test "invalid UTF-8 encoding returns a 400 Bad Request" do
with_routing do |set|
- ActiveSupport::Deprecation.silence do
- set.draw do
- get "/bar/:id", :to => redirect("/foo/show/%{id}")
- get "/foo/show(/:id)", :to => "test_invalid_urls/foo#show"
+ set.draw do
+ get "/bar/:id", :to => redirect("/foo/show/%{id}")
+ get "/foo/show(/:id)", :to => "test_invalid_urls/foo#show"
- ActiveSupport::Deprecation.silence do
- get "/foo(/:action(/:id))", :controller => "test_invalid_urls/foo"
- get "/:controller(/:action(/:id))"
- end
+ ok = lambda { |env| [200, { 'Content-Type' => 'text/plain' }, []] }
+ get '/foobar/:id', to: ok
+
+ ActiveSupport::Deprecation.silence do
+ get "/foo(/:action(/:id))", :controller => "test_invalid_urls/foo"
+ get "/:controller(/:action(/:id))"
end
end
@@ -4347,6 +4355,9 @@ class TestInvalidUrls < ActionDispatch::IntegrationTest
get "/bar/%E2%EF%BF%BD%A6"
assert_response :bad_request
+
+ get "/foobar/%E2%EF%BF%BD%A6"
+ assert_response :bad_request
end
end
end
@@ -4767,7 +4778,9 @@ class TestPathParameters < ActionDispatch::IntegrationTest
end
end
- get ':controller(/:action/(:id))'
+ ActiveSupport::Deprecation.silence do
+ get ':controller(/:action/(:id))'
+ end
end
end