Skip to content

Instantly share code, notes, and snippets.

@kiote
Created January 18, 2016 10:10
Show Gist options
  • Save kiote/03f13db920a90fff0701 to your computer and use it in GitHub Desktop.
Save kiote/03f13db920a90fff0701 to your computer and use it in GitHub Desktop.
ENV['RAILS_ENV'] = 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rspec/rails'
require 'capybara/rspec'
require 'headless'
RSpec.configure do |config|
headless = Headless.new
config.before(:suite) do
headless.start
end
config.after(:suite) do
headless.stop
end
end
# WebKit in stead of Selenium (default), to run JS headlessly
Capybara.javascript_driver = :webkit
Capybara::Webkit.configure do |config|
config.block_unknown_urls
end
Rails.application.reload_routes!
ActiveSupport::Dependencies.clear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment