aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-08-08 12:22:21 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-08-08 12:22:21 -0300
commitd919fd88ecbf79c969cf1896cb293345e43efb6a (patch)
tree66680a823c5c925e60a7e55cf293967727f674a2 /actionpack/test/dispatch
parent12f08acbacf823041dae27afd1a1a1458bb1e3fa (diff)
parent2992b1c04c555c6483245257eab16026dd0fd889 (diff)
downloadrails-d919fd88ecbf79c969cf1896cb293345e43efb6a.tar.gz
rails-d919fd88ecbf79c969cf1896cb293345e43efb6a.tar.bz2
rails-d919fd88ecbf79c969cf1896cb293345e43efb6a.zip
Merge pull request #11352 from xaviershay/dispatcher-api
Allow a custom dispatcher to be provided to routing.
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r--actionpack/test/dispatch/mapper_test.rb4
-rw-r--r--actionpack/test/dispatch/routing_test.rb15
2 files changed, 10 insertions, 9 deletions
diff --git a/actionpack/test/dispatch/mapper_test.rb b/actionpack/test/dispatch/mapper_test.rb
index 889f9a4736..aed1d914f9 100644
--- a/actionpack/test/dispatch/mapper_test.rb
+++ b/actionpack/test/dispatch/mapper_test.rb
@@ -19,6 +19,10 @@ module ActionDispatch
ActionDispatch::Request
end
+ def dispatcher_class
+ RouteSet::Dispatcher
+ end
+
def add_route(*args)
routes << args
end
diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb
index b18a9ab647..280b258da6 100644
--- a/actionpack/test/dispatch/routing_test.rb
+++ b/actionpack/test/dispatch/routing_test.rb
@@ -168,12 +168,10 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
end
def test_session_singleton_resource_for_api_app
- self.class.stub_controllers do |_|
- config = ActionDispatch::Routing::RouteSet::Config.new
- config.api_only = true
-
- routes = ActionDispatch::Routing::RouteSet.new(config)
+ config = ActionDispatch::Routing::RouteSet::Config.new
+ config.api_only = true
+ self.class.stub_controllers(config) do |routes|
routes.draw do
resource :session do
get :create
@@ -550,11 +548,10 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
end
def test_projects_for_api_app
- self.class.stub_controllers do |_|
- config = ActionDispatch::Routing::RouteSet::Config.new
- config.api_only = true
+ config = ActionDispatch::Routing::RouteSet::Config.new
+ config.api_only = true
- routes = ActionDispatch::Routing::RouteSet.new(config)
+ self.class.stub_controllers(config) do |routes|
routes.draw do
resources :projects, controller: :project
end