Permalink
Browse files

Fix railties tests

  • Loading branch information...
1 parent 85e0a6c commit 5fba5409f7cffc67a5966fc386c945b5a935c60c @josh josh committed Sep 26, 2009
@@ -510,7 +510,7 @@ def self.run(initializer = nil, config = nil)
# # Setup database middleware after initializers have run
Initializer.default.add :initialize_database_middleware do
if configuration.frameworks.include?(:active_record)
- if configuration.frameworks.include?(:action_controller) &&
+ if configuration.frameworks.include?(:action_controller) && ActionController::Base.session_store &&
ActionController::Base.session_store.name == 'ActiveRecord::SessionStore'
configuration.middleware.insert_before :"ActiveRecord::SessionStore", ActiveRecord::ConnectionAdapters::ConnectionManagement
configuration.middleware.insert_before :"ActiveRecord::SessionStore", ActiveRecord::QueryCache
@@ -581,6 +581,8 @@ def self.run(initializer = nil, config = nil)
end
Initializer.default.add :build_application do
- Rails.application = Rails::Application.new
+ if configuration.frameworks.include?(:action_controller)
+ Rails.application = Rails::Application.new
+ end
end
end
@@ -18,6 +18,8 @@
require 'active_support'
require 'active_support/test_case'
+require 'action_controller'
+
if defined?(RAILS_ROOT)
RAILS_ROOT.replace File.dirname(__FILE__)
else
@@ -1,6 +1,6 @@
require "isolation/abstract_unit"
require "rails"
-require "rack"
+require 'action_dispatch'
module ApplicationTests
class LoadTest < Test::Unit::TestCase
@@ -6,6 +6,9 @@ class PathsTest < Test::Unit::TestCase
def self.setup
Rails::Initializer.run do |config|
config.frameworks = [:action_controller, :action_view, :action_mailer, :active_record]
+ config.after_initialize do
+ ActionController::Base.session_store = nil
+ end
end
end

0 comments on commit 5fba540

Please sign in to comment.