aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--actionpack/lib/action_dispatch/routing/deprecated_mapper.rb2
-rw-r--r--actionpack/test/abstract_unit.rb8
-rw-r--r--actionpack/test/activerecord/polymorphic_routes_test.rb30
3 files changed, 25 insertions, 15 deletions
diff --git a/actionpack/lib/action_dispatch/routing/deprecated_mapper.rb b/actionpack/lib/action_dispatch/routing/deprecated_mapper.rb
index 61c2253763..bc3f62fb48 100644
--- a/actionpack/lib/action_dispatch/routing/deprecated_mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/deprecated_mapper.rb
@@ -30,6 +30,8 @@ module ActionDispatch
class DeprecatedMapper #:nodoc:
def initialize(set) #:nodoc:
+ ActiveSupport::Deprecation.warn "You are using the old router DSL which will be removed in Rails 3.1. " <<
+ "Please check how to update your router file at: http://www.engineyard.com/blog/2010/the-lowdown-on-routes-in-rails-3/"
@set = set
end
diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb
index 3241b3d118..c8477fb83f 100644
--- a/actionpack/test/abstract_unit.rb
+++ b/actionpack/test/abstract_unit.rb
@@ -41,6 +41,14 @@ require 'pp' # require 'pp' early to prevent hidden_methods from not picking up
module Rails
end
+# Monkey patch the old router initialization to be silenced.
+class ActionDispatch::Routing::DeprecatedMapper
+ def initialize_with_silencer(*args)
+ ActiveSupport::Deprecation.silence { initialize_without_silencer(*args) }
+ end
+ alias_method_chain :initialize, :silencer
+end
+
ActiveSupport::Dependencies.hook!
# Show backtraces for deprecated behavior for quicker cleanup.
diff --git a/actionpack/test/activerecord/polymorphic_routes_test.rb b/actionpack/test/activerecord/polymorphic_routes_test.rb
index 6e1e6cdd20..90a1ef982c 100644
--- a/actionpack/test/activerecord/polymorphic_routes_test.rb
+++ b/actionpack/test/activerecord/polymorphic_routes_test.rb
@@ -408,18 +408,18 @@ class PolymorphicRoutesTest < ActionController::TestCase
def with_admin_test_routes(options = {})
with_routing do |set|
- set.draw do |map|
- map.namespace :admin do |admin|
- admin.resources :projects do |projects|
- projects.resources :tasks
- projects.resource :bid do |bid|
- bid.resources :tasks
+ set.draw do
+ namespace :admin do
+ resources :projects do
+ resources :tasks
+ resource :bid do
+ resources :tasks
end
end
- admin.resources :taxes do |taxes|
- taxes.resources :faxes
+ resources :taxes do
+ resources :faxes
end
- admin.resources :series
+ resources :series
end
end
@@ -430,12 +430,12 @@ class PolymorphicRoutesTest < ActionController::TestCase
def with_admin_and_site_test_routes(options = {})
with_routing do |set|
- set.draw do |map|
- map.namespace :admin do |admin|
- admin.resources :projects do |projects|
- projects.namespace :site do |site|
- site.resources :tasks do |tasks|
- tasks.resources :steps
+ set.draw do
+ namespace :admin do
+ resources :projects do
+ namespace :site do
+ resources :tasks do
+ resources :steps
end
end
end