Remove references to ActionDispatch::Routing::Routes in favor of Rails.appication.routes.
This commit is contained in:
parent
60ca754b97
commit
ba57575e03
2
Gemfile
2
Gemfile
@ -1,5 +1,5 @@
|
||||
path File.dirname(__FILE__)
|
||||
source 'http://gemcutter.org'
|
||||
source 'http://rubygems.org'
|
||||
|
||||
gem "rails", "3.0.0.beta1"
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
ActionDispatch::Routing::Routes.draw do |map|
|
||||
Rails.application.routes.draw do |map|
|
||||
match '/rails/info/properties' => "rails/info#properties"
|
||||
end
|
||||
|
@ -1,9 +1,9 @@
|
||||
desc 'Print out all defined routes in match order, with names. Target specific controller with CONTROLLER=x.'
|
||||
task :routes => :environment do
|
||||
Rails::Application.reload_routes!
|
||||
all_routes = ENV['CONTROLLER'] ? ActionDispatch::Routing::Routes.routes.select { |route| route.defaults[:controller] == ENV['CONTROLLER'] } : ActionDispatch::Routing::Routes.routes
|
||||
all_routes = ENV['CONTROLLER'] ? Rails.application.routes.routes.select { |route| route.defaults[:controller] == ENV['CONTROLLER'] } : Rails.application.routes.routes
|
||||
routes = all_routes.collect do |route|
|
||||
name = ActionDispatch::Routing::Routes.named_routes.routes.index(route).to_s
|
||||
name = Rails.application.routes.named_routes.routes.index(route).to_s
|
||||
reqs = route.requirements.empty? ? "" : route.requirements.inspect
|
||||
{:name => name, :verb => route.verb.to_s, :path => route.path, :reqs => reqs}
|
||||
end
|
||||
|
@ -14,7 +14,7 @@ class InfoControllerTest < ActionController::TestCase
|
||||
tests Rails::InfoController
|
||||
|
||||
def setup
|
||||
ActionDispatch::Routing::Routes.draw do |map|
|
||||
Rails.application.routes.draw do |map|
|
||||
match ':controller/:action'
|
||||
end
|
||||
@controller.stubs(:consider_all_requests_local? => false, :local_request? => true)
|
||||
|
@ -133,7 +133,7 @@ def self.call(env)
|
||||
end
|
||||
end
|
||||
|
||||
ActionDispatch::Routing::Routes.draw do
|
||||
Rails.application.routes.draw do
|
||||
match "/sprokkit", :to => Sprokkit
|
||||
end
|
||||
RUBY
|
||||
@ -170,7 +170,7 @@ def index
|
||||
RUBY
|
||||
|
||||
@plugin.write "config/routes.rb", <<-RUBY
|
||||
ActionDispatch::Routing::Routes.draw do |map|
|
||||
Rails.application.routes.draw do |map|
|
||||
match 'foo', :to => 'bar#index'
|
||||
match 'bar', :to => 'bar#index'
|
||||
end
|
||||
@ -261,7 +261,7 @@ def self.call(env)
|
||||
|
||||
def test_namespaced_controllers_with_namespaced_routes
|
||||
@plugin.write "config/routes.rb", <<-RUBY
|
||||
ActionDispatch::Routing::Routes.draw do
|
||||
Rails.application.routes.draw do
|
||||
namespace :admin do
|
||||
match "index", :to => "admin/foo#index"
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user