diff options
author | Carlhuda <carlhuda@engineyard.com> | 2010-03-02 14:40:59 -0800 |
---|---|---|
committer | Carlhuda <carlhuda@engineyard.com> | 2010-03-02 14:41:12 -0800 |
commit | d78e3fe73fccb90ddb25dc04f9643b83cae2b9e3 (patch) | |
tree | 84d54e34951b8e7f96376445ee38a7ed8a3539c6 | |
parent | 9f83cdc38e03dc3e65a702b00dc4a3cc0bb44e60 (diff) | |
download | rails-d78e3fe73fccb90ddb25dc04f9643b83cae2b9e3.tar.gz rails-d78e3fe73fccb90ddb25dc04f9643b83cae2b9e3.tar.bz2 rails-d78e3fe73fccb90ddb25dc04f9643b83cae2b9e3.zip |
Fix failing Action Pack tests
-rw-r--r-- | actionpack/lib/action_view/test_case.rb | 2 | ||||
-rw-r--r-- | actionpack/test/abstract_unit.rb | 10 | ||||
-rw-r--r-- | actionpack/test/activerecord/controller_runtime_test.rb | 2 | ||||
-rw-r--r-- | actionpack/test/controller/log_subscriber_test.rb | 3 | ||||
-rw-r--r-- | actionpack/test/template/log_subscriber_test.rb | 2 |
5 files changed, 15 insertions, 4 deletions
diff --git a/actionpack/lib/action_view/test_case.rb b/actionpack/lib/action_view/test_case.rb index af2ed33f3f..f639700eaf 100644 --- a/actionpack/lib/action_view/test_case.rb +++ b/actionpack/lib/action_view/test_case.rb @@ -152,7 +152,7 @@ module ActionView 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 660cabc554..f1e8779cfa 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -203,6 +203,16 @@ 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 + @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 d089830857..331f861d8f 100644 --- a/actionpack/test/activerecord/controller_runtime_test.rb +++ b/actionpack/test/activerecord/controller_runtime_test.rb @@ -17,9 +17,9 @@ class ControllerRuntimeLogSubscriberTest < ActionController::TestCase 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 668d6ae5ea..1f8134822c 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 @@ class ACLogSubscriberTest < ActionController::TestCase 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 2eb2484cf5..5076dfa70f 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 |