Use ActionDispatch::Routing everywhere
This commit is contained in:
parent
4cdfe98d92
commit
6bc24d40d5
|
@ -61,7 +61,7 @@ class ActionMailerUrlTest < Test::Unit::TestCase
|
||||||
def test_signed_up_with_url
|
def test_signed_up_with_url
|
||||||
TestMailer.delivery_method = :test
|
TestMailer.delivery_method = :test
|
||||||
|
|
||||||
ActionController::Routing::Routes.draw do |map|
|
ActionDispatch::Routing::Routes.draw do |map|
|
||||||
map.connect ':controller/:action/:id'
|
map.connect ':controller/:action/:id'
|
||||||
map.welcome 'welcome', :controller=>"foo", :action=>"bar"
|
map.welcome 'welcome', :controller=>"foo", :action=>"bar"
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
ActionController::AbstractRequest = ActionController::Request = ActionDispatch::Request
|
ActionController::AbstractRequest = ActionController::Request = ActionDispatch::Request
|
||||||
ActionController::AbstractResponse = ActionController::Response = ActionDispatch::Response
|
ActionController::AbstractResponse = ActionController::Response = ActionDispatch::Response
|
||||||
ActionController::Routing = ActionDispatch::Routing
|
ActionController::Routing = ActionDispatch::Routing
|
||||||
ActionController::Routing::Routes = ActionDispatch::Routing::RouteSet.new
|
|
||||||
ActionController::UrlWriter = ActionController::UrlFor
|
ActionController::UrlWriter = ActionController::UrlFor
|
||||||
|
|
|
@ -20,8 +20,8 @@ module ActionController
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
delegate :default_charset=, :to => "ActionDispatch::Response"
|
delegate :default_charset=, :to => "ActionDispatch::Response"
|
||||||
delegate :resources_path_names, :to => "ActionController::Routing::Routes"
|
delegate :resources_path_names, :to => "ActionDispatch::Routing::Routes"
|
||||||
delegate :resources_path_names=, :to => "ActionController::Routing::Routes"
|
delegate :resources_path_names=, :to => "ActionDispatch::Routing::Routes"
|
||||||
end
|
end
|
||||||
|
|
||||||
# cattr_reader :protected_instance_variables
|
# cattr_reader :protected_instance_variables
|
||||||
|
|
|
@ -6,7 +6,7 @@ module ActionController
|
||||||
# is also possible: an URL can be generated from one of your routing definitions.
|
# is also possible: an URL can be generated from one of your routing definitions.
|
||||||
# URL generation functionality is centralized in this module.
|
# URL generation functionality is centralized in this module.
|
||||||
#
|
#
|
||||||
# See ActionController::Routing and ActionController::Resources for general
|
# See ActionDispatch::Routing and ActionController::Resources for general
|
||||||
# information about routing and routes.rb.
|
# information about routing and routes.rb.
|
||||||
#
|
#
|
||||||
# <b>Tip:</b> If you need to generate URLs from your models or some other place,
|
# <b>Tip:</b> If you need to generate URLs from your models or some other place,
|
||||||
|
@ -87,7 +87,7 @@ module ActionController
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
included do
|
included do
|
||||||
ActionController::Routing::Routes.install_helpers(self)
|
ActionDispatch::Routing::Routes.install_helpers(self)
|
||||||
|
|
||||||
# Including in a class uses an inheritable hash. Modules get a plain hash.
|
# Including in a class uses an inheritable hash. Modules get a plain hash.
|
||||||
if respond_to?(:class_attribute)
|
if respond_to?(:class_attribute)
|
||||||
|
|
|
@ -19,7 +19,7 @@ module ActionController
|
||||||
|
|
||||||
def assign_parameters(controller_path, action, parameters = {})
|
def assign_parameters(controller_path, action, parameters = {})
|
||||||
parameters = parameters.symbolize_keys.merge(:controller => controller_path, :action => action)
|
parameters = parameters.symbolize_keys.merge(:controller => controller_path, :action => action)
|
||||||
extra_keys = ActionController::Routing::Routes.extra_keys(parameters)
|
extra_keys = ActionDispatch::Routing::Routes.extra_keys(parameters)
|
||||||
non_path_parameters = get? ? query_parameters : request_parameters
|
non_path_parameters = get? ? query_parameters : request_parameters
|
||||||
parameters.each do |key, value|
|
parameters.each do |key, value|
|
||||||
if value.is_a? Fixnum
|
if value.is_a? Fixnum
|
||||||
|
|
|
@ -204,6 +204,7 @@ module ActionDispatch
|
||||||
autoload :DeprecatedMapper, 'action_dispatch/routing/deprecated_mapper'
|
autoload :DeprecatedMapper, 'action_dispatch/routing/deprecated_mapper'
|
||||||
autoload :Mapper, 'action_dispatch/routing/mapper'
|
autoload :Mapper, 'action_dispatch/routing/mapper'
|
||||||
autoload :Route, 'action_dispatch/routing/route'
|
autoload :Route, 'action_dispatch/routing/route'
|
||||||
|
autoload :Routes, 'action_dispatch/routing/routes'
|
||||||
autoload :RouteSet, 'action_dispatch/routing/route_set'
|
autoload :RouteSet, 'action_dispatch/routing/route_set'
|
||||||
|
|
||||||
SEPARATORS = %w( / . ? )
|
SEPARATORS = %w( / . ? )
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
# A singleton that stores the current route set
|
||||||
|
ActionDispatch::Routing::Routes = ActionDispatch::Routing::RouteSet.new
|
||||||
|
|
||||||
|
# To preserve compatibility with pre-3.0 Rails action_controller/deprecated.rb
|
||||||
|
# defines ActionDispatch::Routing::Routes as an alias
|
|
@ -80,7 +80,7 @@ module ActionDispatch
|
||||||
expected_path = "/#{expected_path}" unless expected_path[0] == ?/
|
expected_path = "/#{expected_path}" unless expected_path[0] == ?/
|
||||||
# Load routes.rb if it hasn't been loaded.
|
# Load routes.rb if it hasn't been loaded.
|
||||||
|
|
||||||
generated_path, extra_keys = ActionController::Routing::Routes.generate_extras(options, defaults)
|
generated_path, extra_keys = ActionDispatch::Routing::Routes.generate_extras(options, defaults)
|
||||||
found_extras = options.reject {|k, v| ! extra_keys.include? k}
|
found_extras = options.reject {|k, v| ! extra_keys.include? k}
|
||||||
|
|
||||||
msg = build_message(message, "found extras <?>, not <?>", found_extras, extras)
|
msg = build_message(message, "found extras <?>, not <?>", found_extras, extras)
|
||||||
|
@ -125,7 +125,7 @@ module ActionDispatch
|
||||||
end
|
end
|
||||||
|
|
||||||
# A helper to make it easier to test different route configurations.
|
# A helper to make it easier to test different route configurations.
|
||||||
# This method temporarily replaces ActionController::Routing::Routes
|
# This method temporarily replaces ActionDispatch::Routing::Routes
|
||||||
# with a new RouteSet instance.
|
# with a new RouteSet instance.
|
||||||
#
|
#
|
||||||
# The new instance is yielded to the passed block. Typically the block
|
# The new instance is yielded to the passed block. Typically the block
|
||||||
|
@ -142,22 +142,22 @@ module ActionDispatch
|
||||||
# end
|
# end
|
||||||
#
|
#
|
||||||
def with_routing
|
def with_routing
|
||||||
real_routes = ActionController::Routing::Routes
|
real_routes = ActionDispatch::Routing::Routes
|
||||||
ActionController::Routing.module_eval { remove_const :Routes }
|
ActionDispatch::Routing.module_eval { remove_const :Routes }
|
||||||
|
|
||||||
temporary_routes = ActionController::Routing::RouteSet.new
|
temporary_routes = ActionDispatch::Routing::RouteSet.new
|
||||||
ActionController::Routing.module_eval { const_set :Routes, temporary_routes }
|
ActionDispatch::Routing.module_eval { const_set :Routes, temporary_routes }
|
||||||
|
|
||||||
yield temporary_routes
|
yield temporary_routes
|
||||||
ensure
|
ensure
|
||||||
if ActionController::Routing.const_defined? :Routes
|
if ActionDispatch::Routing.const_defined? :Routes
|
||||||
ActionController::Routing.module_eval { remove_const :Routes }
|
ActionDispatch::Routing.module_eval { remove_const :Routes }
|
||||||
end
|
end
|
||||||
ActionController::Routing.const_set(:Routes, real_routes) if real_routes
|
ActionDispatch::Routing.const_set(:Routes, real_routes) if real_routes
|
||||||
end
|
end
|
||||||
|
|
||||||
def method_missing(selector, *args, &block)
|
def method_missing(selector, *args, &block)
|
||||||
if @controller && ActionController::Routing::Routes.named_routes.helpers.include?(selector)
|
if @controller && ActionDispatch::Routing::Routes.named_routes.helpers.include?(selector)
|
||||||
@controller.send(selector, *args, &block)
|
@controller.send(selector, *args, &block)
|
||||||
else
|
else
|
||||||
super
|
super
|
||||||
|
@ -174,7 +174,7 @@ module ActionDispatch
|
||||||
request.env["REQUEST_METHOD"] = request_method.to_s.upcase if request_method
|
request.env["REQUEST_METHOD"] = request_method.to_s.upcase if request_method
|
||||||
request.path = path
|
request.path = path
|
||||||
|
|
||||||
params = ActionController::Routing::Routes.recognize_path(path, { :method => request.method })
|
params = ActionDispatch::Routing::Routes.recognize_path(path, { :method => request.method })
|
||||||
request.path_parameters = params.with_indifferent_access
|
request.path_parameters = params.with_indifferent_access
|
||||||
|
|
||||||
request
|
request
|
||||||
|
|
|
@ -188,11 +188,11 @@ module ActionDispatch
|
||||||
unless defined? @named_routes_configured
|
unless defined? @named_routes_configured
|
||||||
# install the named routes in this session instance.
|
# install the named routes in this session instance.
|
||||||
klass = metaclass
|
klass = metaclass
|
||||||
ActionController::Routing::Routes.install_helpers(klass)
|
ActionDispatch::Routing::Routes.install_helpers(klass)
|
||||||
|
|
||||||
# the helpers are made protected by default--we make them public for
|
# the helpers are made protected by default--we make them public for
|
||||||
# easier access during testing and troubleshooting.
|
# easier access during testing and troubleshooting.
|
||||||
klass.module_eval { public *ActionController::Routing::Routes.named_routes.helpers }
|
klass.module_eval { public *ActionDispatch::Routing::Routes.named_routes.helpers }
|
||||||
@named_routes_configured = true
|
@named_routes_configured = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -8,7 +8,7 @@ module ActionView
|
||||||
# Full usage example:
|
# Full usage example:
|
||||||
#
|
#
|
||||||
# config/routes.rb:
|
# config/routes.rb:
|
||||||
# ActionController::Routing::Routes.draw do |map|
|
# ActionDispatch::Routing::Routes.draw do |map|
|
||||||
# map.resources :posts
|
# map.resources :posts
|
||||||
# map.root :controller => "posts"
|
# map.root :controller => "posts"
|
||||||
# end
|
# end
|
||||||
|
|
|
@ -5,7 +5,7 @@ require 'active_support/core_ext/hash/keys'
|
||||||
module ActionView
|
module ActionView
|
||||||
module Helpers #:nodoc:
|
module Helpers #:nodoc:
|
||||||
# Provides a set of methods for making links and getting URLs that
|
# Provides a set of methods for making links and getting URLs that
|
||||||
# depend on the routing subsystem (see ActionController::Routing).
|
# depend on the routing subsystem (see ActionDispatch::Routing).
|
||||||
# This allows you to use the same format for links in views
|
# This allows you to use the same format for links in views
|
||||||
# and controllers.
|
# and controllers.
|
||||||
module UrlHelper
|
module UrlHelper
|
||||||
|
|
|
@ -152,7 +152,7 @@ module ActionView
|
||||||
end
|
end
|
||||||
|
|
||||||
def method_missing(selector, *args)
|
def method_missing(selector, *args)
|
||||||
if ActionController::Routing::Routes.named_routes.helpers.include?(selector)
|
if ActionDispatch::Routing::Routes.named_routes.helpers.include?(selector)
|
||||||
@controller.__send__(selector, *args)
|
@controller.__send__(selector, *args)
|
||||||
else
|
else
|
||||||
super
|
super
|
||||||
|
|
|
@ -76,7 +76,7 @@ class ActiveSupport::TestCase
|
||||||
# Hold off drawing routes until all the possible controller classes
|
# Hold off drawing routes until all the possible controller classes
|
||||||
# have been loaded.
|
# have been loaded.
|
||||||
setup_once do
|
setup_once do
|
||||||
ActionController::Routing::Routes.draw do |map|
|
ActionDispatch::Routing::Routes.draw do |map|
|
||||||
match ':controller(/:action(/:id))'
|
match ':controller(/:action(/:id))'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -92,7 +92,7 @@ class ActionController::IntegrationTest < ActiveSupport::TestCase
|
||||||
middleware.use "ActionDispatch::Cookies"
|
middleware.use "ActionDispatch::Cookies"
|
||||||
middleware.use "ActionDispatch::Flash"
|
middleware.use "ActionDispatch::Flash"
|
||||||
middleware.use "ActionDispatch::Head"
|
middleware.use "ActionDispatch::Head"
|
||||||
}.build(routes || ActionController::Routing::Routes)
|
}.build(routes || ActionDispatch::Routing::Routes)
|
||||||
end
|
end
|
||||||
|
|
||||||
self.app = build_app
|
self.app = build_app
|
||||||
|
@ -118,19 +118,19 @@ class ActionController::IntegrationTest < ActiveSupport::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
def with_routing(&block)
|
def with_routing(&block)
|
||||||
real_routes = ActionController::Routing::Routes
|
real_routes = ActionDispatch::Routing::Routes
|
||||||
ActionController::Routing.module_eval { remove_const :Routes }
|
ActionDispatch::Routing.module_eval { remove_const :Routes }
|
||||||
|
|
||||||
temporary_routes = ActionController::Routing::RouteSet.new
|
temporary_routes = ActionDispatch::Routing::RouteSet.new
|
||||||
self.class.app = self.class.build_app(temporary_routes)
|
self.class.app = self.class.build_app(temporary_routes)
|
||||||
ActionController::Routing.module_eval { const_set :Routes, temporary_routes }
|
ActionDispatch::Routing.module_eval { const_set :Routes, temporary_routes }
|
||||||
|
|
||||||
yield temporary_routes
|
yield temporary_routes
|
||||||
ensure
|
ensure
|
||||||
if ActionController::Routing.const_defined? :Routes
|
if ActionDispatch::Routing.const_defined? :Routes
|
||||||
ActionController::Routing.module_eval { remove_const :Routes }
|
ActionDispatch::Routing.module_eval { remove_const :Routes }
|
||||||
end
|
end
|
||||||
ActionController::Routing.const_set(:Routes, real_routes) if real_routes
|
ActionDispatch::Routing.const_set(:Routes, real_routes) if real_routes
|
||||||
self.class.app = self.class.build_app
|
self.class.app = self.class.build_app
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -400,7 +400,7 @@ class PolymorphicRoutesTest < ActionController::TestCase
|
||||||
map.resources :series
|
map.resources :series
|
||||||
end
|
end
|
||||||
|
|
||||||
ActionController::Routing::Routes.install_helpers(self.class)
|
ActionDispatch::Routing::Routes.install_helpers(self.class)
|
||||||
yield
|
yield
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -422,7 +422,7 @@ class PolymorphicRoutesTest < ActionController::TestCase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
ActionController::Routing::Routes.install_helpers(self.class)
|
ActionDispatch::Routing::Routes.install_helpers(self.class)
|
||||||
yield
|
yield
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -441,7 +441,7 @@ class PolymorphicRoutesTest < ActionController::TestCase
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
ActionController::Routing::Routes.install_helpers(self.class)
|
ActionDispatch::Routing::Routes.install_helpers(self.class)
|
||||||
yield
|
yield
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -326,7 +326,7 @@ class RescueTest < ActionController::IntegrationTest
|
||||||
end
|
end
|
||||||
|
|
||||||
test 'rescue routing exceptions' do
|
test 'rescue routing exceptions' do
|
||||||
@app = ActionDispatch::Rescue.new(ActionController::Routing::Routes) do
|
@app = ActionDispatch::Rescue.new(ActionDispatch::Routing::Routes) do
|
||||||
rescue_from ActionController::RoutingError, lambda { |env| [200, {"Content-Type" => "text/html"}, ["Gotcha!"]] }
|
rescue_from ActionController::RoutingError, lambda { |env| [200, {"Content-Type" => "text/html"}, ["Gotcha!"]] }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -335,7 +335,7 @@ class RescueTest < ActionController::IntegrationTest
|
||||||
end
|
end
|
||||||
|
|
||||||
test 'unrescued exception' do
|
test 'unrescued exception' do
|
||||||
@app = ActionDispatch::Rescue.new(ActionController::Routing::Routes)
|
@app = ActionDispatch::Rescue.new(ActionDispatch::Routing::Routes)
|
||||||
assert_raise(ActionController::RoutingError) { get '/b00m' }
|
assert_raise(ActionController::RoutingError) { get '/b00m' }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -394,7 +394,7 @@ class ResourcesTest < ActionController::TestCase
|
||||||
assert_restful_routes_for :messages do |options|
|
assert_restful_routes_for :messages do |options|
|
||||||
assert_recognizes(options.merge(:action => "new"), :path => "/messages/new", :method => :get)
|
assert_recognizes(options.merge(:action => "new"), :path => "/messages/new", :method => :get)
|
||||||
assert_raise(ActionController::RoutingError) do
|
assert_raise(ActionController::RoutingError) do
|
||||||
ActionController::Routing::Routes.recognize_path("/messages/new", :method => :post)
|
ActionDispatch::Routing::Routes.recognize_path("/messages/new", :method => :post)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -504,7 +504,7 @@ class ResourcesTest < ActionController::TestCase
|
||||||
|
|
||||||
def test_restful_routes_dont_generate_duplicates
|
def test_restful_routes_dont_generate_duplicates
|
||||||
with_restful_routing :messages do
|
with_restful_routing :messages do
|
||||||
routes = ActionController::Routing::Routes.routes
|
routes = ActionDispatch::Routing::Routes.routes
|
||||||
routes.each do |route|
|
routes.each do |route|
|
||||||
routes.each do |r|
|
routes.each do |r|
|
||||||
next if route === r # skip the comparison instance
|
next if route === r # skip the comparison instance
|
||||||
|
|
|
@ -476,8 +476,8 @@ XML
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_with_routing_places_routes_back
|
def test_with_routing_places_routes_back
|
||||||
assert ActionController::Routing::Routes
|
assert ActionDispatch::Routing::Routes
|
||||||
routes_id = ActionController::Routing::Routes.object_id
|
routes_id = ActionDispatch::Routing::Routes.object_id
|
||||||
|
|
||||||
begin
|
begin
|
||||||
with_routing { raise 'fail' }
|
with_routing { raise 'fail' }
|
||||||
|
@ -485,8 +485,8 @@ XML
|
||||||
rescue RuntimeError
|
rescue RuntimeError
|
||||||
end
|
end
|
||||||
|
|
||||||
assert ActionController::Routing::Routes
|
assert ActionDispatch::Routing::Routes
|
||||||
assert_equal routes_id, ActionController::Routing::Routes.object_id
|
assert_equal routes_id, ActionDispatch::Routing::Routes.object_id
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_remote_addr
|
def test_remote_addr
|
||||||
|
|
|
@ -245,7 +245,7 @@ class WebServiceTest < ActionController::IntegrationTest
|
||||||
private
|
private
|
||||||
def with_params_parsers(parsers = {})
|
def with_params_parsers(parsers = {})
|
||||||
old_session = @integration_session
|
old_session = @integration_session
|
||||||
@app = ActionDispatch::ParamsParser.new(ActionController::Routing::Routes, parsers)
|
@app = ActionDispatch::ParamsParser.new(ActionDispatch::Routing::Routes, parsers)
|
||||||
reset!
|
reset!
|
||||||
yield
|
yield
|
||||||
ensure
|
ensure
|
||||||
|
|
|
@ -728,14 +728,14 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
|
||||||
|
|
||||||
private
|
private
|
||||||
def with_test_routes
|
def with_test_routes
|
||||||
real_routes, temp_routes = ActionController::Routing::Routes, Routes
|
real_routes, temp_routes = ActionDispatch::Routing::Routes, Routes
|
||||||
|
|
||||||
ActionController::Routing.module_eval { remove_const :Routes }
|
ActionDispatch::Routing.module_eval { remove_const :Routes }
|
||||||
ActionController::Routing.module_eval { const_set :Routes, temp_routes }
|
ActionDispatch::Routing.module_eval { const_set :Routes, temp_routes }
|
||||||
|
|
||||||
yield
|
yield
|
||||||
ensure
|
ensure
|
||||||
ActionController::Routing.module_eval { remove_const :Routes }
|
ActionDispatch::Routing.module_eval { remove_const :Routes }
|
||||||
ActionController::Routing.const_set(:Routes, real_routes)
|
ActionDispatch::Routing.const_set(:Routes, real_routes)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
ActionController::Routing::Routes.draw do |map|
|
ActionDispatch::Routing::Routes.draw do |map|
|
||||||
match '/rails/info/properties' => "rails/info#properties"
|
match '/rails/info/properties' => "rails/info#properties"
|
||||||
end
|
end
|
|
@ -48,7 +48,7 @@ module Rails
|
||||||
end
|
end
|
||||||
|
|
||||||
def routes
|
def routes
|
||||||
::ActionController::Routing::Routes
|
::ActionDispatch::Routing::Routes
|
||||||
end
|
end
|
||||||
|
|
||||||
def railties
|
def railties
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
desc 'Print out all defined routes in match order, with names. Target specific controller with CONTROLLER=x.'
|
desc 'Print out all defined routes in match order, with names. Target specific controller with CONTROLLER=x.'
|
||||||
task :routes => :environment do
|
task :routes => :environment do
|
||||||
Rails::Application.reload_routes!
|
Rails::Application.reload_routes!
|
||||||
all_routes = ENV['CONTROLLER'] ? ActionController::Routing::Routes.routes.select { |route| route.defaults[:controller] == ENV['CONTROLLER'] } : ActionController::Routing::Routes.routes
|
all_routes = ENV['CONTROLLER'] ? ActionDispatch::Routing::Routes.routes.select { |route| route.defaults[:controller] == ENV['CONTROLLER'] } : ActionDispatch::Routing::Routes.routes
|
||||||
routes = all_routes.collect do |route|
|
routes = all_routes.collect do |route|
|
||||||
name = ActionController::Routing::Routes.named_routes.routes.index(route).to_s
|
name = ActionDispatch::Routing::Routes.named_routes.routes.index(route).to_s
|
||||||
reqs = route.requirements.empty? ? "" : route.requirements.inspect
|
reqs = route.requirements.empty? ? "" : route.requirements.inspect
|
||||||
{:name => name, :verb => route.verb.to_s, :path => route.path, :reqs => reqs}
|
{:name => name, :verb => route.verb.to_s, :path => route.path, :reqs => reqs}
|
||||||
end
|
end
|
||||||
|
|
|
@ -14,7 +14,7 @@ class InfoControllerTest < ActionController::TestCase
|
||||||
tests Rails::InfoController
|
tests Rails::InfoController
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
ActionController::Routing::Routes.draw do |map|
|
ActionDispatch::Routing::Routes.draw do |map|
|
||||||
match ':controller/:action'
|
match ':controller/:action'
|
||||||
end
|
end
|
||||||
@controller.stubs(:consider_all_requests_local? => false, :local_request? => true)
|
@controller.stubs(:consider_all_requests_local? => false, :local_request? => true)
|
||||||
|
|
|
@ -133,7 +133,7 @@ module RailtiesTest
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
ActionController::Routing::Routes.draw do
|
ActionDispatch::Routing::Routes.draw do
|
||||||
match "/sprokkit", :to => Sprokkit
|
match "/sprokkit", :to => Sprokkit
|
||||||
end
|
end
|
||||||
RUBY
|
RUBY
|
||||||
|
@ -170,7 +170,7 @@ module RailtiesTest
|
||||||
RUBY
|
RUBY
|
||||||
|
|
||||||
@plugin.write "config/routes.rb", <<-RUBY
|
@plugin.write "config/routes.rb", <<-RUBY
|
||||||
ActionController::Routing::Routes.draw do |map|
|
ActionDispatch::Routing::Routes.draw do |map|
|
||||||
match 'foo', :to => 'bar#index'
|
match 'foo', :to => 'bar#index'
|
||||||
match 'bar', :to => 'bar#index'
|
match 'bar', :to => 'bar#index'
|
||||||
end
|
end
|
||||||
|
@ -261,7 +261,7 @@ YAML
|
||||||
|
|
||||||
def test_namespaced_controllers_with_namespaced_routes
|
def test_namespaced_controllers_with_namespaced_routes
|
||||||
@plugin.write "config/routes.rb", <<-RUBY
|
@plugin.write "config/routes.rb", <<-RUBY
|
||||||
ActionController::Routing::Routes.draw do
|
ActionDispatch::Routing::Routes.draw do
|
||||||
namespace :admin do
|
namespace :admin do
|
||||||
match "index", :to => "admin/foo#index"
|
match "index", :to => "admin/foo#index"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue