forked from rspec/rspec-rails
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcapybara.rb
32 lines (28 loc) · 846 Bytes
/
capybara.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
begin
require 'capybara/rspec'
rescue LoadError
end
begin
require 'capybara/rails'
rescue LoadError
end
if defined?(Capybara)
RSpec.configure do |c|
if defined?(Capybara::DSL)
c.include Capybara::DSL, type: :feature
c.include Capybara::DSL, type: :system
end
if defined?(Capybara::RSpecMatchers)
c.include Capybara::RSpecMatchers, type: :view
c.include Capybara::RSpecMatchers, type: :helper
c.include Capybara::RSpecMatchers, type: :mailer
c.include Capybara::RSpecMatchers, type: :controller
c.include Capybara::RSpecMatchers, type: :feature
c.include Capybara::RSpecMatchers, type: :system
end
unless defined?(Capybara::RSpecMatchers) || defined?(Capybara::DSL)
c.include Capybara, type: :request
c.include Capybara, type: :controller
end
end
end