Sha256: 0beb8c07d28a65cb2f5ec6a9a293f6b95a021cd001ee643f5f6f72f8272286c3

Contents?: true

Size: 910 Bytes

Versions: 2

Compression:

Stored size: 910 Bytes

Contents

module QUnit
  module Rails
    class Engine < ::Rails::Engine
      isolate_namespace QUnit::Rails

      config.qunit = ActiveSupport::OrderedOptions.new
      config.qunit.tests_path       = "test"
      config.qunit.javascripts_path = "javascripts"
      config.qunit.stylesheets_path = "stylesheets"

      # https://github.com/rails/sprockets-rails/issues/299#issuecomment-167701012
      # This doesn't really make sense since the assets are not going to be
      # available in production.
      config.after_initialize do
        ActiveSupport.on_load(:action_view) do
          default_checker = ActionView::Base.precompiled_asset_checker

          ActionView::Base.precompiled_asset_checker = -> logical_path do
           default_checker[logical_path] ||
           %w{qunit.js qunit.css test_helper.css test_helper.js}.include?(logical_path)
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
discourse-qunit-rails-0.0.11 lib/qunit/rails/engine.rb
discourse-qunit-rails-0.0.9 lib/qunit/rails/engine.rb