Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 25 lines (23 sloc) 0.802 kb
aa46894 Add RSpec support in Capybara itself, closes #187
Anders Törnqvist authored
1 require 'capybara'
2 require 'capybara/dsl'
558e7b2 @joliss Use the :request type for RSpec example groups
joliss authored
3 require 'rspec/core'
f5552df Move matchers into folder
Jonas Nicklas and Nicklas Ramhöj authored
4 require 'capybara/rspec/matchers'
f4897f8 Added DSL for acceptance tests in RSpec
Jonas Nicklas and Nicklas Ramhöj authored
5 require 'capybara/rspec/features'
aa46894 Add RSpec support in Capybara itself, closes #187
Anders Törnqvist authored
6
7abde02 @jnicklas Correct module name for RSpec, prevent deprecation warnings
authored
7 RSpec.configure do |config|
de34c63 @jnicklas set rspec type to :feature instead
authored
8 config.include Capybara::DSL, :type => :feature
9 config.include Capybara::RSpecMatchers, :type => :feature
558e7b2 @joliss Use the :request type for RSpec example groups
joliss authored
10 # The before and after blocks must run instantaneously, because Capybara
11 # might not actually be used in all examples where it's included.
aa46894 Add RSpec support in Capybara itself, closes #187
Anders Törnqvist authored
12 config.after do
31f1ac3 @jnicklas Separate DSL out into a module
authored
13 if self.class.include?(Capybara::DSL)
bdde00a @jnicklas Only mix in Capybara into :type => :acceptance examples
authored
14 Capybara.reset_sessions!
15 Capybara.use_default_driver
16 end
aa46894 Add RSpec support in Capybara itself, closes #187
Anders Törnqvist authored
17 end
18 config.before do
31f1ac3 @jnicklas Separate DSL out into a module
authored
19 if self.class.include?(Capybara::DSL)
bdde00a @jnicklas Only mix in Capybara into :type => :acceptance examples
authored
20 Capybara.current_driver = Capybara.javascript_driver if example.metadata[:js]
21 Capybara.current_driver = example.metadata[:driver] if example.metadata[:driver]
22 end
aa46894 Add RSpec support in Capybara itself, closes #187
Anders Törnqvist authored
23 end
24 end
Something went wrong with that request. Please try again.