Sha256: 4178d9c96155bf72c501a151af500dbaff22f4fa5306446069641b2c9e5125cc

Contents?: true

Size: 802 Bytes

Versions: 7

Compression:

Stored size: 802 Bytes

Contents

require 'capybara'
require 'capybara/dsl'
require 'rspec/core'
require 'capybara/rspec/matchers'
require 'capybara/rspec/features'

RSpec.configure do |config|
  config.include Capybara::DSL, :type => :feature
  config.include Capybara::RSpecMatchers, :type => :feature
  # The before and after blocks must run instantaneously, because Capybara
  # might not actually be used in all examples where it's included.
  config.after do
    if self.class.include?(Capybara::DSL)
      Capybara.reset_sessions!
      Capybara.use_default_driver
    end
  end
  config.before do
    if self.class.include?(Capybara::DSL)
      Capybara.current_driver = Capybara.javascript_driver if example.metadata[:js]
      Capybara.current_driver = example.metadata[:driver] if example.metadata[:driver]
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
swipe-rails-0.0.5 vendor/bundle/gems/capybara-2.1.0/lib/capybara/rspec.rb
capybara-2.1.0 lib/capybara/rspec.rb
capybara-2.1.0.rc1 lib/capybara/rspec.rb
capybara-2.0.3 lib/capybara/rspec.rb
capybara-2.1.0.beta1 lib/capybara/rspec.rb
capybara-2.0.2 lib/capybara/rspec.rb
capybara-2.0.1 lib/capybara/rspec.rb