The first Capybara integration test always tends to timeout when compiling assets on-demand. It’s just damn too slow. Precompile your assets before the test is run.
RSpec.configure do |config|
config.before :all do
ENV['PRECOMPILE_ASSETS'] ||= case self.class.metadata[:type]
when :feature, :view
$stdout.write 'Precompiling assets...'
Sprockets::StaticCompiler.new(
Rails.application.assets,
File.join(Rails.public_path, Rails.configuration.assets.prefix),
Rails.configuration.assets.precompile,
manifest_path: Rails.configuration.assets.manifest,
digest: Rails.configuration.assets.digest,
manifest: false
).compile
$stdout.puts ' done.'
Time.now.to_s
end
end
end
