Created
May 7, 2012 15:36
-
-
Save jugyo/2628471 to your computer and use it in GitHub Desktop.
spec_helper.rb for sinatra app to use capybara with selenium driver
This file contains 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['APP_ENV'] = 'test' | |
require_relative '../app.rb' | |
disable :run | |
require 'capybara' | |
require 'capybara/dsl' | |
Capybara.app = Sinatra::Application | |
if ENV['TEST_BROWSER'] | |
Capybara.register_driver :selenium do |app| | |
Capybara::Selenium::Driver.new(app, :browser => ENV['TEST_BROWSER'].to_sym) | |
end | |
Capybara.current_driver = :selenium | |
end | |
RSpec.configure do |config| | |
config.include Capybara::DSL | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment