require 'capybara/rspec' require 'capybara/rails' require 'capybara/poltergeist' RSpec.configure do |config| config.include Rack::Test::Methods, type: :requests Capybara.javascript_driver = :poltergeist Capybara.register_driver(:poltergeist) do |app| Capybara::Poltergeist::Driver.new app, js_errors: true, timeout: 60 end end