Skip to content

Commit

Permalink
Fix failing Action Pack tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlhuda committed Mar 2, 2010
1 parent 9f83cdc commit d78e3fe
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion actionpack/lib/action_view/test_case.rb
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions actionpack/test/abstract_unit.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion actionpack/test/activerecord/controller_runtime_test.rb
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion actionpack/test/controller/log_subscriber_test.rb
Expand Up @@ -40,14 +40,15 @@ 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__))
ActionController::Base.page_cache_directory = @cache_path
ActionController::Base.cache_store = :file_store, @cache_path

Rails::LogSubscriber.add(:action_controller, ActionController::Railties::LogSubscriber.new)
super
end

def teardown
Expand Down
2 changes: 1 addition & 1 deletion actionpack/test/template/log_subscriber_test.rb
Expand Up @@ -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
Expand Down

0 comments on commit d78e3fe

Please sign in to comment.