Created
January 18, 2016 10:10
-
-
Save kiote/03f13db920a90fff0701 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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