Sha256: 6c50a21a69f2bcb27a55e909f9fecd4a7bd7fc0898730d1c76e65b2a7172710b

Contents?: true

Size: 831 Bytes

Versions: 6

Compression:

Stored size: 831 Bytes

Contents

require 'test_helper'
require 'fileutils'
require 'find'
require 'shellwords'

class SprocketsRailsTest < Minitest::Test

  def test_sprockets_digest_asset_refs
    root     = 'test/dummy_rails'
    command  = "bundle exec rake assets:precompile GEMFILE=#{GEM_PATH}/Gemfile RAILS_ENV=production"
    compiled = Dir.chdir root do
      silence_stderr_if !ENV['VERBOSE'] do
        system(command)
      end
    end
    assert compiled, 'Could not precompile assets'
    Dir.glob(File.join(root, 'public', 'assets', 'app*.{css,js}')) do |path|
      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
    FileUtils.rm_rf %W(#{root}/public/assets/ #{root}/tmp/cache/), secure: true
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
bootstrap-sass-3.2.0.4 test/sprockets_rails_test.rb
bootstrap-sass-backport-3.3.1.0 test/sprockets_rails_test.rb
bootstrap-sass-3.3.1.0 test/sprockets_rails_test.rb
bootstrap-sass-3.3.0.1 test/sprockets_rails_test.rb
bootstrap-sass-3.3.0.0 test/sprockets_rails_test.rb
bootstrap-sass-backport-3.2.0.2 test/sprockets_rails_test.rb