c:/mowes/www/rails_projects/sample_app/spec/spec_helper.rb:4:in `block in ': uninitialized constant Capybara (NameError)
spec/spec_helper.rb
# This file is copied to spec/ when you run 'rails generate rspec:install'
RSpec.configure do |config|
config.include Capybara::DSL
end
I have gem 'capybara', '2.1.0'
in my Gemfile so I don't know what's going on.
You have to add config.include Capybara::DSL
to rails_helper.rb
, and not into spec_helper.rb
. It worked for me perfectly!