diff options
author | Robin Dupret <robin.dupret@gmail.com> | 2014-03-08 15:51:49 +0100 |
---|---|---|
committer | Robin Dupret <robin.dupret@gmail.com> | 2014-03-08 15:59:22 +0100 |
commit | 9c53b8b89f0b4aec5a2ec3611cefae8e7b6514a5 (patch) | |
tree | faba48d0f7d7ff2209e178eb420fc50645584468 /railties/test/application | |
parent | dc8bfc8ab62c3e3a776297226ef43027bc7d09c1 (diff) | |
download | rails-9c53b8b89f0b4aec5a2ec3611cefae8e7b6514a5.tar.gz rails-9c53b8b89f0b4aec5a2ec3611cefae8e7b6514a5.tar.bz2 rails-9c53b8b89f0b4aec5a2ec3611cefae8e7b6514a5.zip |
Make the rails:template rake task load initializers
Templates could rely on irregular inflections or external libraries for
instance so we should load the application's initializers when running
the rails:template task.
The introducing commit of this feature is f7f11361 ; the initializers
have never been loaded invoking this task.
Fixes #12133.
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/rake_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb index 317e73245c..e8c8de9f73 100644 --- a/railties/test/application/rake_test.rb +++ b/railties/test/application/rake_test.rb @@ -271,5 +271,16 @@ module ApplicationTests end end end + + def test_template_load_initializers + app_file "config/initializers/dummy.rb", "puts 'Hello, World!'" + app_file "template.rb", "" + + output = Dir.chdir(app_path) do + `bundle exec rake rails:template LOCATION=template.rb` + end + + assert_match(/Hello, World!/, output) + end end end |