aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/abstract_unit.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/abstract_unit.rb')
-rw-r--r--actionpack/test/abstract_unit.rb53
1 files changed, 22 insertions, 31 deletions
diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb
index 7080a87f42..3540af13ac 100644
--- a/actionpack/test/abstract_unit.rb
+++ b/actionpack/test/abstract_unit.rb
@@ -124,7 +124,7 @@ module ActiveSupport
match ':controller(/:action)'
end
- ActionController::IntegrationTest.app.routes.draw do
+ ActionDispatch::IntegrationTest.app.routes.draw do
match ':controller(/:action)'
end
end
@@ -163,9 +163,7 @@ class ActionDispatch::IntegrationTest < ActiveSupport::TestCase
setup do
@routes = SharedTestRoutes
end
-end
-class ActionController::IntegrationTest < ActiveSupport::TestCase
def self.build_app(routes = nil)
RoutedRackApp.new(routes || ActionDispatch::Routing::RouteSet.new) do |middleware|
middleware.use "ActionDispatch::ShowExceptions"
@@ -232,7 +230,7 @@ class ActionController::IntegrationTest < ActiveSupport::TestCase
end
# Temporary base class
-class Rack::TestCase < ActionController::IntegrationTest
+class Rack::TestCase < ActionDispatch::IntegrationTest
def self.testing(klass = nil)
if klass
@testing = "/#{klass.name.underscore}".sub!(/_controller$/, '')
@@ -274,33 +272,20 @@ class Rack::TestCase < ActionController::IntegrationTest
end
end
-class ActionController::Base
- def self.test_routes(&block)
- routes = ActionDispatch::Routing::RouteSet.new
- routes.draw(&block)
- include routes.url_helpers
- end
-end
-
-class ::ApplicationController < ActionController::Base
-end
-
-module ActionView
- class TestCase
- # Must repeat the setup because AV::TestCase is a duplication
- # of AC::TestCase
- setup do
- @routes = SharedTestRoutes
- end
- end
-end
-
module ActionController
class Base
include ActionController::Testing
- end
+ # This stub emulates the Railtie including the URL helpers from a Rails application
+ include SharedTestRoutes.url_helpers
- Base.view_paths = FIXTURE_LOAD_PATH
+ self.view_paths = FIXTURE_LOAD_PATH
+
+ def self.test_routes(&block)
+ routes = ActionDispatch::Routing::RouteSet.new
+ routes.draw(&block)
+ include routes.url_helpers
+ end
+ end
class TestCase
include ActionDispatch::TestProcess
@@ -311,9 +296,15 @@ module ActionController
end
end
-# This stub emulates the Railtie including the URL helpers from a Rails application
-module ActionController
- class Base
- include SharedTestRoutes.url_helpers
+class ::ApplicationController < ActionController::Base
+end
+
+module ActionView
+ class TestCase
+ # Must repeat the setup because AV::TestCase is a duplication
+ # of AC::TestCase
+ setup do
+ @routes = SharedTestRoutes
+ end
end
end