Lors de l'exécution de mes spécifications avec rspec & capybara, la méthode de visite de capybara est introuvable. Y a-t-il une autre étape d'initialisation que je dois faire?
$bundle exec rspec spec
/home/brian/projects/expense_track/expense_track/spec/requests/homepage_spec.rb:6:in `block (2 levels) in <top (required)>': undefined method `visit' for #<Class:0xb6572b8> (NoMethodError)
Gemfile:
group :test, :development do
gem "rspec-rails"
gem "capybara"
end
haut de mon spec_helper.rb:
# This file is copied to spec/ when you run 'rails generate rspec:install'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'capybara/rspec'
require 'rspec/autorun'
homepage_spec.rb:
require 'spec_helper'
describe "The home page" do
context "home page exists" do
visit "/"
page.should have_content("elephants")
end
end