diff options
author | José Valim <jose.valim@gmail.com> | 2010-02-19 08:02:28 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-02-19 08:15:49 +0100 |
commit | e49f94d71cdcdd3b891959e59203fd5e664c8add (patch) | |
tree | 84d0ec6beac626b8c42dd3a3730266805fe22f31 /railties/test/application | |
parent | e2806929ec4bc3d429011039f4b046b600b7c8f8 (diff) | |
download | rails-e49f94d71cdcdd3b891959e59203fd5e664c8add.tar.gz rails-e49f94d71cdcdd3b891959e59203fd5e664c8add.tar.bz2 rails-e49f94d71cdcdd3b891959e59203fd5e664c8add.zip |
Revert behavior from a5684dfa3c16472bfa5d5d861ba78cb6dbadcb59 and ensure after_initializer is executed after to_prepare callbacks.
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/initializers/initializers_test.rb | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/railties/test/application/initializers/initializers_test.rb b/railties/test/application/initializers/initializers_test.rb index a6d37b15f1..2e6a707175 100644 --- a/railties/test/application/initializers/initializers_test.rb +++ b/railties/test/application/initializers/initializers_test.rb @@ -52,9 +52,22 @@ module ApplicationTests assert $activerecord_configurations['development'] end - test "after_initialize happens before to_prepare (i.e. before the middleware stack is built) on production" do + test "after_initialize happens after to_prepare in development" do $order = [] add_to_config <<-RUBY + config.cache_classes = false + config.after_initialize { $order << :after_initialize } + config.to_prepare { $order << :to_prepare } + RUBY + + require "#{app_path}/config/environment" + assert [:to_prepare, :after_initialize], $order + end + + test "after_initialize happens after to_prepare in production" do + $order = [] + add_to_config <<-RUBY + config.cache_classes = true config.after_initialize { $order << :after_initialize } config.to_prepare { $order << :to_prepare } RUBY @@ -62,8 +75,7 @@ module ApplicationTests require "#{app_path}/config/application" Rails.env.replace "production" require "#{app_path}/config/environment" - assert [:after_initialize, :to_prepare], $order + assert [:to_prepare, :after_initialize], $order end - end end |