diff options
author | Carlhuda <carlhuda@engineyard.com> | 2009-12-23 14:55:12 -0800 |
---|---|---|
committer | Carlhuda <carlhuda@engineyard.com> | 2009-12-23 16:13:09 -0800 |
commit | 38aeb1528c376f7a058beea6db0a328720b85f01 (patch) | |
tree | c7bb623d13b49e7861e531ec05ba4f2f2c770a0b /railties/test/application | |
parent | fa8dfc7d014f6768599077b79a874894e13d317f (diff) | |
download | rails-38aeb1528c376f7a058beea6db0a328720b85f01.tar.gz rails-38aeb1528c376f7a058beea6db0a328720b85f01.tar.bz2 rails-38aeb1528c376f7a058beea6db0a328720b85f01.zip |
Moving out some framework specific initializers into the framework libraries.
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/initializer_test.rb | 40 |
1 files changed, 17 insertions, 23 deletions
diff --git a/railties/test/application/initializer_test.rb b/railties/test/application/initializer_test.rb index 8ed8e11c8f..2ecc3e9e2d 100644 --- a/railties/test/application/initializer_test.rb +++ b/railties/test/application/initializer_test.rb @@ -135,21 +135,9 @@ module ApplicationTests assert !Rails.application.config.middleware.include?(ActiveRecord::SessionStore) end - test "database middleware doesn't initialize when activerecord is not in frameworks" do - add_to_config <<-RUBY - config.root = "#{app_path}" - config.frameworks = [] - RUBY - require "#{app_path}/config/environment" - - assert_equal [], Rails.application.config.middleware - end - test "database middleware initializes when session store is active record" do - add_to_config <<-RUBY - config.root = "#{app_path}" - config.action_controller.session_store = :active_record_store - RUBY + add_to_config "config.action_controller.session_store = :active_record_store" + require "#{app_path}/config/environment" expects = [ActiveRecord::ConnectionAdapters::ConnectionManagement, ActiveRecord::QueryCache, ActiveRecord::SessionStore] @@ -157,22 +145,28 @@ module ApplicationTests assert_equal expects, middleware & expects end - test "ensure database middleware doesn't use action_controller on initializing" do + test "Rails.root should be a Pathname" do add_to_config <<-RUBY config.root = "#{app_path}" - config.frameworks -= [:action_controller] - config.action_controller.session_store = :active_record_store RUBY require "#{app_path}/config/environment" + assert_instance_of Pathname, Rails.root + end + end - assert !Rails.application.config.middleware.include?(ActiveRecord::SessionStore) + class InitializerCustomFrameworkExtensionsTest < Test::Unit::TestCase + include ActiveSupport::Testing::Isolation + + def setup + build_app + boot_rails end - test "Rails.root should be a Pathname" do - add_to_config <<-RUBY - config.root = "#{app_path}" - RUBY + + test "database middleware doesn't initialize when activerecord is not in frameworks" do + use_frameworks [] require "#{app_path}/config/environment" - assert_instance_of Pathname, Rails.root + + assert !defined?(ActiveRecord) end end end
\ No newline at end of file |