diff options
author | José Valim <jose.valim@gmail.com> | 2010-02-18 18:39:39 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-02-18 18:56:11 +0100 |
commit | a5684dfa3c16472bfa5d5d861ba78cb6dbadcb59 (patch) | |
tree | b66a2d0cba3215d7c651c473cdc415a95a01f791 /railties/test/application | |
parent | 1477a6101da631a117427a1e53668dfe093a3726 (diff) | |
download | rails-a5684dfa3c16472bfa5d5d861ba78cb6dbadcb59.tar.gz rails-a5684dfa3c16472bfa5d5d861ba78cb6dbadcb59.tar.bz2 rails-a5684dfa3c16472bfa5d5d861ba78cb6dbadcb59.zip |
Ensure config.after_initializer is executed before building the middleware stack.
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/initializers/initializers_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/railties/test/application/initializers/initializers_test.rb b/railties/test/application/initializers/initializers_test.rb index 0c3de7ce33..a6d37b15f1 100644 --- a/railties/test/application/initializers/initializers_test.rb +++ b/railties/test/application/initializers/initializers_test.rb @@ -51,5 +51,19 @@ module ApplicationTests assert $activerecord_configurations assert $activerecord_configurations['development'] end + + test "after_initialize happens before to_prepare (i.e. before the middleware stack is built) on production" do + $order = [] + add_to_config <<-RUBY + config.after_initialize { $order << :after_initialize } + config.to_prepare { $order << :to_prepare } + RUBY + + require "#{app_path}/config/application" + Rails.env.replace "production" + require "#{app_path}/config/environment" + assert [:after_initialize, :to_prepare], $order + end + end end |