According to Rspec Request Specs
Capybara is no longer supported in request specs as of Capybara 2.0.0.
Why I still can use Capybara methods from inside Request specs; such as visit
, click_link
, click_button
?
My related Gemfile.lock
entries:
capybara (~> 2.15.1)
rspec-rails (~> 3.5, >= 3.5.2)
Most likely because you’re including `Capybara::DSL into all of your test types. Check your code for something like
RSpec.configure do |config|
...
config.include Capybara::DSL # includes into every type of test
...
and remove the include line, it should already be correctly configured by requiring ‘capybara/rspec’.