diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2013-06-21 08:19:41 -0700 |
---|---|---|
committer | Guillermo Iguaran <guilleiguaran@gmail.com> | 2013-06-21 08:19:41 -0700 |
commit | 3f34f75d72775a38a2a5a150b510b93490e2a024 (patch) | |
tree | 34845f1603082a1fe89a052af81b3264d6023683 /railties | |
parent | 12fe66b56479abc2ca399c002d38a7e81fce2eb2 (diff) | |
parent | 9da48a998c6f8102bfc83b80e65edbcc542036c6 (diff) | |
download | rails-3f34f75d72775a38a2a5a150b510b93490e2a024.tar.gz rails-3f34f75d72775a38a2a5a150b510b93490e2a024.tar.bz2 rails-3f34f75d72775a38a2a5a150b510b93490e2a024.zip |
Merge pull request #10537 from jetthoughts/10428_bug_with_config_assets_precompile
#10428: Added tests for config.assets.precompile
Diffstat (limited to 'railties')
-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" |