diff options
author | Paul Nikitochkin <paul.nikitochkin@gmail.com> | 2013-05-08 22:10:40 +0300 |
---|---|---|
committer | Paul Nikitochkin <paul.nikitochkin@gmail.com> | 2013-06-21 01:08:59 +0300 |
commit | 9da48a998c6f8102bfc83b80e65edbcc542036c6 (patch) | |
tree | 35a3d7f71c88e4e6061d881ab20b2268b85a7d7c | |
parent | 7c69a829a311a31109939cff19b700b36b97d5c4 (diff) | |
download | rails-9da48a998c6f8102bfc83b80e65edbcc542036c6.tar.gz rails-9da48a998c6f8102bfc83b80e65edbcc542036c6.tar.bz2 rails-9da48a998c6f8102bfc83b80e65edbcc542036c6.zip |
#10428: Added tests for config.assets.precompile
Tests for bug in sprocket-rails:
do not use value of configuration options
which changed after environment loaded
-rw-r--r-- | railties/test/application/assets_test.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/railties/test/application/assets_test.rb b/railties/test/application/assets_test.rb index 94446c6c1b..633d864dac 100644 --- a/railties/test/application/assets_test.rb +++ b/railties/test/application/assets_test.rb @@ -165,6 +165,29 @@ module ApplicationTests assert_file_exists("#{app_path}/public/assets/something-*.js") end + test 'precompile use assets defined in app env config' do + add_to_env_config 'production', 'config.assets.precompile = [ "something.js" ]' + + app_file 'app/assets/javascripts/something.js.erb', 'alert();' + + precompile! 'RAILS_ENV=production' + + assert_file_exists("#{app_path}/public/assets/something-*.js") + end + + test 'precompile use assets defined in app config and reassigned in app env config' do + add_to_config 'config.assets.precompile = [ "something.js" ]' + add_to_env_config 'production', 'config.assets.precompile += [ "another.js" ]' + + app_file 'app/assets/javascripts/something.js.erb', 'alert();' + app_file 'app/assets/javascripts/another.js.erb', 'alert();' + + precompile! 'RAILS_ENV=production' + + assert_file_exists("#{app_path}/public/assets/something-*.js") + assert_file_exists("#{app_path}/public/assets/another-*.js") + end + test "asset pipeline should use a Sprockets::Index when config.assets.digest is true" do add_to_config "config.assets.digest = true" add_to_config "config.action_controller.perform_caching = false" |