diff --git a/actionpack/lib/action_view/test_case.rb b/actionpack/lib/action_view/test_case.rb index af2ed33f3f976b49ce617618096b267e55defb62..f639700eaf92223399c8dc4f7c16285ab35e0407 100644 --- a/actionpack/lib/action_view/test_case.rb +++ b/actionpack/lib/action_view/test_case.rb @@ -152,7 +152,7 @@ def _assigns end def method_missing(selector, *args) - if ActionDispatch::Routing::Routes.named_routes.helpers.include?(selector) + if @controller._router.named_routes.helpers.include?(selector) @controller.__send__(selector, *args) else super diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index 660cabc554d568c2d87e95d0ab046a7bf23e90af..f1e8779cfa4c242e6637d4c2c6fb4f505fbf41c3 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -203,6 +203,16 @@ def assert_header(name, value) class ::ApplicationController < ActionController::Base end +module ActionView + class TestCase + # Must repeat the setup because AV::TestCase is a duplication + # of AC::TestCase + setup do + @router = SharedTestRoutes + end + end +end + module ActionController class Base include ActionController::Testing diff --git a/actionpack/test/activerecord/controller_runtime_test.rb b/actionpack/test/activerecord/controller_runtime_test.rb index d08983085772e9dca98a3a97b71eb04d547675f1..331f861d8f361fcce3bccfb88326ed4d00a6a02b 100644 --- a/actionpack/test/activerecord/controller_runtime_test.rb +++ b/actionpack/test/activerecord/controller_runtime_test.rb @@ -17,9 +17,9 @@ def show tests LogSubscriberController def setup + super @old_logger = ActionController::Base.logger Rails::LogSubscriber.add(:action_controller, ActionController::Railties::LogSubscriber.new) - super end def teardown diff --git a/actionpack/test/controller/log_subscriber_test.rb b/actionpack/test/controller/log_subscriber_test.rb index 668d6ae5ea69ee0afaaa76942d3f0cdafb55a834..1f8134822c66153b10b3a72df270dc4b4857fb23 100644 --- a/actionpack/test/controller/log_subscriber_test.rb +++ b/actionpack/test/controller/log_subscriber_test.rb @@ -40,6 +40,8 @@ class ACLogSubscriberTest < ActionController::TestCase include Rails::LogSubscriber::TestHelper def setup + super + @old_logger = ActionController::Base.logger @cache_path = File.expand_path('../temp/test_cache', File.dirname(__FILE__)) @@ -47,7 +49,6 @@ def setup ActionController::Base.cache_store = :file_store, @cache_path Rails::LogSubscriber.add(:action_controller, ActionController::Railties::LogSubscriber.new) - super end def teardown diff --git a/actionpack/test/template/log_subscriber_test.rb b/actionpack/test/template/log_subscriber_test.rb index 2eb2484cf59ebeab4b27d19f53a47207bbf629dd..5076dfa70fb25beda4eea0c0ef9d99909d6be2af 100644 --- a/actionpack/test/template/log_subscriber_test.rb +++ b/actionpack/test/template/log_subscriber_test.rb @@ -7,11 +7,11 @@ class AVLogSubscriberTest < ActiveSupport::TestCase include Rails::LogSubscriber::TestHelper def setup + super @old_logger = ActionController::Base.logger @view = ActionView::Base.new(ActionController::Base.view_paths, {}) Rails.stubs(:root).returns(File.expand_path(FIXTURE_LOAD_PATH)) Rails::LogSubscriber.add(:action_view, ActionView::Railties::LogSubscriber.new) - super end def teardown