Sha256: a2b500df5ab6464b5eebef377d53bb1fb5ed7397aec58d976da60d8a85d4a8bb

Contents?: true

Size: 942 Bytes

Versions: 14

Compression:

Stored size: 942 Bytes

Contents

# frozen_string_literal: true

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

class SprocketsRailsTest < Minitest::Test

  def test_sprockets_digest_asset_refs
    root = 'test/dummy_rails'
    compiled = Dir.chdir root do
      silence_stderr_if !ENV['VERBOSE'] do
        Bundler.with_original_env do
          system({ 'BUNDLE_GEMFILE' => File.join(GEM_PATH, 'Gemfile'),
                   'RAILS_ENV' => 'production' },
                 'bundle && bundle exec rake assets:precompile')
        end
      end
    end
    assert compiled, 'Could not precompile assets'
    Dir.glob(File.join(root, 'public', 'assets', 'app*.{css,js}')) do |path|
      File.read(path)
          .scan(/url\("?[^"]+\.(?:jpg|png|eot|woff2?|ttf|svg)[^"]*"?\)/) do |m|
        assert_match(/-[0-9a-f]{12,}\./, m)
      end
    end
  ensure
    FileUtils.rm_rf %W[#{root}/public/assets/ #{root}/tmp/cache/], secure: true
  end
end

Version data entries

14 entries across 14 versions & 3 rubygems

Version Path
entreprise7pro-bootstrap-sass-3.4.7 test/sprockets_rails_test.rb
entreprise7pro-bootstrap-sass-3.4.6 test/sprockets_rails_test.rb
zuora_connect_ui-0.10.0 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/test/sprockets_rails_test.rb
zuora_connect_ui-0.9.2 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/test/sprockets_rails_test.rb
zuora_connect_ui-0.9.1 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/test/sprockets_rails_test.rb
zuora_connect_ui-0.9.0 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/test/sprockets_rails_test.rb
zuora_connect_ui-0.8.3 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/test/sprockets_rails_test.rb
zuora_connect_ui-0.8.2 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/test/sprockets_rails_test.rb
zuora_connect_ui-0.8.1 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/test/sprockets_rails_test.rb
zuora_connect_ui-0.8.0 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/test/sprockets_rails_test.rb
zuora_connect_ui-0.7.1 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/test/sprockets_rails_test.rb
zuora_connect_ui-0.7.0 vendor/ruby/2.6.0/gems/bootstrap-sass-3.4.1/test/sprockets_rails_test.rb
bootstrap-sass-3.4.1 test/sprockets_rails_test.rb
bootstrap-sass-3.4.0 test/sprockets_rails_test.rb