Skip to content

Instantly share code, notes, and snippets.

@heliohead
Created April 4, 2017 00:06
Show Gist options
  • Save heliohead/25dc21f279aeb01313ec4d1fffb71f46 to your computer and use it in GitHub Desktop.
Save heliohead/25dc21f279aeb01313ec4d1fffb71f46 to your computer and use it in GitHub Desktop.
Compile assets before run rspec features test
# spec/support/feature_helper.rb
RSpec.configure do |config|
config.before :all do
ENV['PRECOMPILE_ASSETS'] ||= begin
case self.class.metadata[:type]
when :feature, :view
STDOUT.write "Precompiling assets..."
system "bundle exec rake assets:precompile > /dev/null 2>&1"
STDOUT.puts "\n 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