Skip to content
Browse files

include Capybara::DSL and Capybara::RSpecMatchers in spec/features

  • Loading branch information...
1 parent 0be66ba commit 9332167de751e3c1c2f240e656e4a7d6e9b44bfa @dchelimsky dchelimsky committed Oct 6, 2012
Showing with 18 additions and 12 deletions.
  1. +18 −12 lib/rspec/rails/vendor/capybara.rb
View
30 lib/rspec/rails/vendor/capybara.rb
@@ -8,20 +8,26 @@
rescue LoadError
end
-RSpec.configure do |c|
- 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
- end
+if defined?(Capybara)
+ RSpec.configure do |c|
+ if defined?(Capybara::DSL)
+ c.include Capybara::DSL, :type => :controller
+ c.include Capybara::DSL, :example_group => {
+ :file_path => c.escaped_path(%w[spec features])
+ }
+ end
- if defined?(Capybara::DSL)
- c.include Capybara::DSL, :type => :controller
- 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, :example_group => {
+ :file_path => c.escaped_path(%w[spec features])
+ }
+ end
- unless defined?(Capybara::RSpecMatchers) || defined?(Capybara::DSL)
- if defined?(Capybara)
+ unless defined?(Capybara::RSpecMatchers) || defined?(Capybara::DSL)
c.include Capybara, :type => :request
c.include Capybara, :type => :controller
end

0 comments on commit 9332167

Please sign in to comment.
Something went wrong with that request. Please try again.