diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-08-16 16:37:56 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-08-16 16:41:01 +0100 |
commit | 590239156714c03ad525b2248a11a3f34da3aa6a (patch) | |
tree | 4ef57a5fae520d2177c850659b0497d709154bc9 | |
parent | 4dd985ae9514fdb9688eab780d881decff8358fa (diff) | |
download | rails-590239156714c03ad525b2248a11a3f34da3aa6a.tar.gz rails-590239156714c03ad525b2248a11a3f34da3aa6a.tar.bz2 rails-590239156714c03ad525b2248a11a3f34da3aa6a.zip |
Fix assets tests in railties
-rw-r--r-- | actionpack/lib/sprockets/assets.rake | 4 | ||||
-rw-r--r-- | railties/test/application/assets_test.rb | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/actionpack/lib/sprockets/assets.rake b/actionpack/lib/sprockets/assets.rake index 9b2646b0a2..4cf5caab91 100644 --- a/actionpack/lib/sprockets/assets.rake +++ b/actionpack/lib/sprockets/assets.rake @@ -9,7 +9,9 @@ namespace :assets do Kernel.exec $0, *ARGV else Rake::Task["environment"].invoke - Sprockets::Helpers::RailsHelper + + # Ensure that action view is loaded and the appropriate sprockets hooks get executed + ActionView::Base assets = Rails.application.config.assets.precompile # Always perform caching so that asset_path appends the timestamps to file references. diff --git a/railties/test/application/assets_test.rb b/railties/test/application/assets_test.rb index 7e68de5674..a8d1382e94 100644 --- a/railties/test/application/assets_test.rb +++ b/railties/test/application/assets_test.rb @@ -54,8 +54,8 @@ module ApplicationTests capture(:stdout) do Dir.chdir(app_path){ `bundle exec rake assets:precompile` } end - files = Dir["#{app_path}/public/assets/application-b29a188b3d9c74ef7cbb7ddf9e99f953.js"] - files << Dir["#{app_path}/public/assets/foo/application-b29a188b3d9c74ef7cbb7ddf9e99f953.js"].first + files = Dir["#{app_path}/public/assets/application-*.js"] + files << Dir["#{app_path}/public/assets/foo/application-*.js"].first files.each do |file| assert_not_nil file, "Expected application.js asset to be generated, but none found" assert_equal "alert()", File.read(file) @@ -68,7 +68,7 @@ module ApplicationTests # capture(:stdout) do Dir.chdir(app_path){ `bundle exec rake assets:precompile RAILS_ENV=test` } # end - file = Dir["#{app_path}/public/assets/application-4bd8b7059c5336ec7ad515c9dbd59974.css"].first + file = Dir["#{app_path}/public/assets/application-*.css"].first assert_match /\/assets\/rails-([0-z]+)\.png/, File.read(file) end @@ -79,7 +79,7 @@ module ApplicationTests capture(:stdout) do Dir.chdir(app_path){ `bundle exec rake assets:precompile RAILS_GROUPS=assets` } end - file = Dir["#{app_path}/public/assets/application-8d301a938f1abfd789bbec87ed1ef770.css"].first + file = Dir["#{app_path}/public/assets/application-*.css"].first assert_match /\/assets\/rails-([0-z]+)\.png/, File.read(file) end |