Skip to content

Instantly share code, notes, and snippets.

@wojtha
Created June 28, 2016 15:18
Show Gist options
  • Select an option

  • Save wojtha/ca2e660c9fb1402974a3c636d3c9192f to your computer and use it in GitHub Desktop.

Select an option

Save wojtha/ca2e660c9fb1402974a3c636d3c9192f to your computer and use it in GitHub Desktop.
Experimental assets compilation before running test suite. However it does not give me any boost.
# See https://github.com/teampoltergeist/poltergeist/issues/677#issuecomment-222919584
# https://dzone.com/articles/precompiling-rails-assets
RSpec.configure do |config|
config.before :all do
ENV['PRECOMPILE_ASSETS'] ||= begin
case self.class.metadata[:type]
when :feature, :view
STDOUT.write "Precompiling assets..."
require 'rake'
Rails.application.load_tasks
Rake::Task['assets:precompile'].invoke
STDOUT.puts " done."
Time.now.to_s
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment