aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorGuillermo Iguaran <guilleiguaran@gmail.com>2013-06-21 08:19:41 -0700
committerGuillermo Iguaran <guilleiguaran@gmail.com>2013-06-21 08:19:41 -0700
commit3f34f75d72775a38a2a5a150b510b93490e2a024 (patch)
tree34845f1603082a1fe89a052af81b3264d6023683 /railties/test
parent12fe66b56479abc2ca399c002d38a7e81fce2eb2 (diff)
parent9da48a998c6f8102bfc83b80e65edbcc542036c6 (diff)
downloadrails-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/test')
-rw-r--r--railties/test/application/assets_test.rb23
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"