Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 18 lines (17 sloc) 0.516 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
require 'capybara'
require 'capybara/dsl'

RSpec.configure do |config|
  config.include Capybara, :type => :acceptance
  config.after do
    if example.metadata[:type] == :acceptance
      Capybara.reset_sessions!
      Capybara.use_default_driver
    end
  end
  config.before do
    if example.metadata[:type] == :acceptance
      Capybara.current_driver = Capybara.javascript_driver if example.metadata[:js]
      Capybara.current_driver = example.metadata[:driver] if example.metadata[:driver]
    end
  end
end
Something went wrong with that request. Please try again.