aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2011-09-26 09:56:38 -0700
committerSantiago Pastorino <santiago@wyeworks.com>2011-09-26 13:57:07 -0300
commitcf90181d8409909803a8325f33e04b5dbdcd6ada (patch)
treef894d28d048de84b19f244b820f82d04e0eb8501 /railties/test
parent17882d2a9e8e93a5f6dbe2278deb73269fff30c9 (diff)
downloadrails-cf90181d8409909803a8325f33e04b5dbdcd6ada.tar.gz
rails-cf90181d8409909803a8325f33e04b5dbdcd6ada.tar.bz2
rails-cf90181d8409909803a8325f33e04b5dbdcd6ada.zip
Merge pull request #3136 from guilleiguaran/clear-digests-on-precompile
Avoid use of existing precompiled assets during rake assets:precompile run
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/application/assets_test.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/railties/test/application/assets_test.rb b/railties/test/application/assets_test.rb
index 12466a3296..118ffff44b 100644
--- a/railties/test/application/assets_test.rb
+++ b/railties/test/application/assets_test.rb
@@ -256,6 +256,24 @@ module ApplicationTests
assert_match(/\/assets\/rails-([0-z]+)\.png/, File.read(file))
end
+ test "precompile shouldn't use the digests present in manifest.yml" do
+ app_file "app/assets/stylesheets/application.css.erb", "<%= asset_path('rails.png') %>"
+
+ ENV["RAILS_ENV"] = "production"
+ precompile!
+
+ manifest = "#{app_path}/public/assets/manifest.yml"
+ assets = YAML.load_file(manifest)
+ asset_path = assets["application.css"]
+
+ app_file "app/assets/images/rails.png", "image changed"
+
+ precompile!
+ assets = YAML.load_file(manifest)
+
+ assert_not_equal asset_path, assets["application.css"]
+ end
+
test "precompile appends the md5 hash to files referenced with asset_path and run in production as default even using RAILS_GROUPS=assets" do
app_file "app/assets/stylesheets/application.css.erb", "<%= asset_path('rails.png') %>"
add_to_config "config.assets.compile = true"