Skip to content
Newer
Older
100644 34 lines (29 sloc) 1.13 KB
07e7777 @twalpole frozen literal magic comment
twalpole authored Mar 7, 2016
1 # frozen_string_literal: true
aa46894 Add RSpec support in Capybara itself, closes #187
Anders Törnqvist authored Dec 10, 2010
2 require 'capybara/dsl'
558e7b2 @joliss Use the :request type for RSpec example groups
joliss authored Feb 3, 2011
3 require 'rspec/core'
f5552df Move matchers into folder
Jonas Nicklas and Nicklas Ramhöj authored Feb 11, 2011
4 require 'capybara/rspec/matchers'
f4897f8 Added DSL for acceptance tests in RSpec
Jonas Nicklas and Nicklas Ramhöj authored Feb 11, 2011
5 require 'capybara/rspec/features'
aa46894 Add RSpec support in Capybara itself, closes #187
Anders Törnqvist authored Dec 10, 2010
6
7abde02 @jnicklas Correct module name for RSpec, prevent deprecation warnings
authored Dec 21, 2010
7 RSpec.configure do |config|
de34c63 @jnicklas set rspec type to :feature instead
authored Sep 7, 2012
8 config.include Capybara::DSL, :type => :feature
9 config.include Capybara::RSpecMatchers, :type => :feature
08a200b @joshuaclayton Allow RSpec view specs to leverage Capybara matchers
joshuaclayton authored Jun 5, 2015
10 config.include Capybara::RSpecMatchers, :type => :view
61cddbe @thomas-holmes Update RSpec config to support RSpec 2 and RSpec 3.
thomas-holmes authored Jul 21, 2013
11
12 # A work-around to support accessing the current example that works in both
13 # RSpec 2 and RSpec 3.
14 fetch_current_example = RSpec.respond_to?(:current_example) ?
15 proc { RSpec.current_example } : proc { |context| context.example }
16
558e7b2 @joliss Use the :request type for RSpec example groups
joliss authored Feb 3, 2011
17 # The before and after blocks must run instantaneously, because Capybara
18 # 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 Dec 10, 2010
19 config.after do
31f1ac3 @jnicklas Separate DSL out into a module
authored Apr 11, 2011
20 if self.class.include?(Capybara::DSL)
bdde00a @jnicklas Only mix in Capybara into :type => :acceptance examples
authored Jan 9, 2011
21 Capybara.reset_sessions!
22 Capybara.use_default_driver
23 end
aa46894 Add RSpec support in Capybara itself, closes #187
Anders Törnqvist authored Dec 10, 2010
24 end
899f3bd @jnicklas Revert "Merge pull request #1123 from thomas-holmes/update-rspec-conf…
authored Jul 21, 2013
25 config.before do
31f1ac3 @jnicklas Separate DSL out into a module
authored Apr 11, 2011
26 if self.class.include?(Capybara::DSL)
61cddbe @thomas-holmes Update RSpec config to support RSpec 2 and RSpec 3.
thomas-holmes authored Jul 22, 2013
27 example = fetch_current_example.call(self)
6f04b04 @thomas-holmes Correct reference to wrong block variable name
thomas-holmes authored Jul 20, 2013
28 Capybara.current_driver = Capybara.javascript_driver if example.metadata[:js]
0dfc564 @thomas-holmes Fix accidental editing error
thomas-holmes authored Jul 21, 2013
29 Capybara.current_driver = example.metadata[:driver] if example.metadata[:driver]
bdde00a @jnicklas Only mix in Capybara into :type => :acceptance examples
authored Jan 9, 2011
30 end
aa46894 Add RSpec support in Capybara itself, closes #187
Anders Törnqvist authored Dec 10, 2010
31 end
32 end
ba37f78 @twalpole Update all tests to "expect" format and add support for RSpec 3 usage
twalpole authored Nov 14, 2013
33
Something went wrong with that request. Please try again.