提交 d78e3fe7 编写于 作者: C Carlhuda

Fix failing Action Pack tests

上级 9f83cdc3
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册