Skip to content
This repository
Newer
Older
100644 25 lines (24 sloc) 0.864 kb
aa46894c » unders
2010-12-10 Add RSpec support in Capybara itself, closes #187
1 require 'capybara'
2 require 'capybara/dsl'
558e7b2d » joliss
2011-02-03 Use the :request type for RSpec example groups
3 require 'rspec/core'
6fea34cf »
2011-02-04 Make RSpec matchers work with session and nodes
4 require 'capybara/rspec_matchers'
aa46894c » unders
2010-12-10 Add RSpec support in Capybara itself, closes #187
5
7abde022 »
2010-12-21 Correct module name for RSpec, prevent deprecation warnings
6 RSpec.configure do |config|
558e7b2d » joliss
2011-02-03 Use the :request type for RSpec example groups
7 config.include Capybara, :type => :request
bdde00af »
2011-01-09 Only mix in Capybara into :type => :acceptance examples
8 config.include Capybara, :type => :acceptance
558e7b2d » joliss
2011-02-03 Use the :request type for RSpec example groups
9 config.include Capybara::RSpecMatchers, :type => :request
6fea34cf »
2011-02-04 Make RSpec matchers work with session and nodes
10 config.include Capybara::RSpecMatchers, :type => :acceptance
558e7b2d » joliss
2011-02-03 Use the :request type for RSpec example groups
11 # The before and after blocks must run instantaneously, because Capybara
12 # might not actually be used in all examples where it's included.
aa46894c » unders
2010-12-10 Add RSpec support in Capybara itself, closes #187
13 config.after do
558e7b2d » joliss
2011-02-03 Use the :request type for RSpec example groups
14 if self.class.include?(Capybara)
bdde00af »
2011-01-09 Only mix in Capybara into :type => :acceptance examples
15 Capybara.reset_sessions!
16 Capybara.use_default_driver
17 end
aa46894c » unders
2010-12-10 Add RSpec support in Capybara itself, closes #187
18 end
19 config.before do
558e7b2d » joliss
2011-02-03 Use the :request type for RSpec example groups
20 if self.class.include?(Capybara)
bdde00af »
2011-01-09 Only mix in Capybara into :type => :acceptance examples
21 Capybara.current_driver = Capybara.javascript_driver if example.metadata[:js]
22 Capybara.current_driver = example.metadata[:driver] if example.metadata[:driver]
23 end
aa46894c » unders
2010-12-10 Add RSpec support in Capybara itself, closes #187
24 end
25 end
Something went wrong with that request. Please try again.