aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2011-12-11 00:12:09 +0100
committerPiotr Sarnacki <drogus@gmail.com>2011-12-11 00:12:09 +0100
commitcde99812f1fcd521552db8f7cf4e183088c157db (patch)
tree5d0ebb3b63961804862fe50b88b65dc40ca6b713 /railties/test/application
parent1c2cb7d740a7418145639be2c97242a5aea9d441 (diff)
downloadrails-cde99812f1fcd521552db8f7cf4e183088c157db.tar.gz
rails-cde99812f1fcd521552db8f7cf4e183088c157db.tar.bz2
rails-cde99812f1fcd521552db8f7cf4e183088c157db.zip
Ensure that files that compile to js/css are not compiled by default with `rake assets:precompile`
This case was not tested and documentation was a bit confusing on that topic, so it was not obvious if current code works properly or not.
Diffstat (limited to 'railties/test/application')
-rw-r--r--railties/test/application/assets_test.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/railties/test/application/assets_test.rb b/railties/test/application/assets_test.rb
index a22013f81c..392bef3fd1 100644
--- a/railties/test/application/assets_test.rb
+++ b/railties/test/application/assets_test.rb
@@ -72,7 +72,7 @@ module ApplicationTests
end
end
- test "precompile application.js and application.css and all other files not ending with .js or .css by default" do
+ test "precompile application.js and application.css and all other non JS/CSS files" do
app_file "app/assets/javascripts/application.js", "alert();"
app_file "app/assets/stylesheets/application.css", "body{}"
@@ -82,8 +82,11 @@ module ApplicationTests
app_file "app/assets/javascripts/something.min.js", "alert();"
app_file "app/assets/stylesheets/something.min.css", "body{}"
+ app_file "app/assets/javascripts/something.else.js.erb", "alert();"
+ app_file "app/assets/stylesheets/something.else.css.erb", "body{}"
+
images_should_compile = ["a.png", "happyface.png", "happy_face.png", "happy.face.png",
- "happy-face.png", "happy.happy_face.png", "happy_happy.face.png",
+ "happy-face.png", "happy.happy_face.png", "happy_happy.face.png",
"happy.happy.face.png", "happy", "happy.face", "-happyface",
"-happy.png", "-happy.face.png", "_happyface", "_happy.face.png",
"_happy.png"]
@@ -106,6 +109,9 @@ module ApplicationTests
assert !File.exists?("#{app_path}/public/assets/something.min.js")
assert !File.exists?("#{app_path}/public/assets/something.min.css")
+
+ assert !File.exists?("#{app_path}/public/assets/something.else.js")
+ assert !File.exists?("#{app_path}/public/assets/something.else.css")
end
test "asset pipeline should use a Sprockets::Index when config.assets.digest is true" do