Sha256: 252562349006e4463754e067f3df8acd8df750f7405d90f5c9464a03db16cda6
Contents?: true
Size: 713 Bytes
Versions: 5
Compression:
Stored size: 713 Bytes
Contents
require 'test_helper' require 'fileutils' require 'find' require 'shellwords' class SprocketsRailsTest < ActiveSupport::TestCase def test_sprockets_digest_asset_refs system "cd #{Shellwords.escape Rails.root.to_s} && bundle exec rake assets:precompile GEMFILE=#{Bootstrap.gem_path}/Gemfile RAILS_ENV=production" Dir.glob(Rails.root.join('public', 'assets', 'app*.*')) do |path| next unless path =~ /\.(css|js)$/ File.open(path, 'r') do |f| f.read.scan /url\("?[^"]+\.(?:jpg|png|eot|woff|ttf|svg)[^"]*"?\)/ do |m| assert_match /-[0-9a-f]{12,}\./, m end end end ensure system "rm -rf #{Rails.root}/public/assets/ #{Rails.root}/tmp/cache/" end end
Version data entries
5 entries across 5 versions & 1 rubygems