aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-07-06 21:38:54 -0300
committerJosé Valim <jose.valim@gmail.com>2011-07-06 21:41:13 -0300
commit2f6e3895a8ea2a39e43525aba91a6dbca977ef6a (patch)
tree6ff56dde61784acf20356e2336331ef82578530f /railties/test/application
parent86390c3bf30dd61f3bac047e0887b74ff422c02f (diff)
downloadrails-2f6e3895a8ea2a39e43525aba91a6dbca977ef6a.tar.gz
rails-2f6e3895a8ea2a39e43525aba91a6dbca977ef6a.tar.bz2
rails-2f6e3895a8ea2a39e43525aba91a6dbca977ef6a.zip
Make compressors lazily load.
Diffstat (limited to 'railties/test/application')
-rw-r--r--railties/test/application/assets_test.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/railties/test/application/assets_test.rb b/railties/test/application/assets_test.rb
index afe93aa732..e1eee71a9e 100644
--- a/railties/test/application/assets_test.rb
+++ b/railties/test/application/assets_test.rb
@@ -35,6 +35,17 @@ module ApplicationTests
assert_match "alert()", last_response.body
end
+ test "assets do not require compressors until it is used" do
+ app_file "app/assets/javascripts/demo.js.erb", "<%= :alert %>();"
+ ENV["RAILS_ENV"] = "production"
+ require "#{app_path}/config/environment"
+
+ assert !defined?(Uglifier)
+ get "/assets/demo.js"
+ assert_match "alert()", last_response.body
+ assert defined?(Uglifier)
+ end
+
test "assets are compiled properly" do
app_file "app/assets/javascripts/application.js", "alert();"
app_file "app/assets/javascripts/foo/application.js", "alert();"