Я изучаю ruby on rails с помощью онлайн-учебника Ruby on Rails Tutorial и наткнулся на это упражнение http://www.railstutorial.org/book/static_pages#code-capybara_dsl
Я следовал инструкции по добавлению
RSpec.configure do |config|
config.include Capybara::DSL
end
в мой spec_helper.rb, но теперь я получаю ошибки
uninitialized constant Capybara <NameError>
Это мой текущий spec_helper.rb
require "spec_helper"
RSpec.configure do |config|
config.include Capybara::DSL
end
describe "Static pages" do
describe "Home page" do
it "should have the content 'Sample App'" do
visit '/static_pages/home'
expect(page).to have_content('Sample App')
end
end
describe "Help page" do
it "should have the content 'Help'" do
visit '/static_pages/help'
expect(page).to have_content('Help')
end
end
describe "About page" do
it "should have the content 'About Us'" do
visit '/static_pages/about'
expect(page).to have_content('About Us')
end
end
end
Что я делаю неправильно? Я неправильно установил гем?
Редактировать: не уверен, что это поможет, но вот вывод неудачных примеров после того, как я назвал $ bundle exec rspec spec/requests/static_pages_spec.rb
←[31mrspec ./spec/spec_helper.rb:7←[0m ←[36m# Static pages Home page should have
the content 'Sample App'←[0m
←[31mrspec ./spec/spec_helper.rb:15←[0m ←[36m# Static pages Help page should hav
e the content 'Help'←[0m
←[31mrspec ./spec/spec_helper.rb:23←[0m ←[36m# Static pages About page should ha
ve the content 'About Us'←[0m
←[31mrspec ./spec/requests/static_pages_spec.rb:5←[0m ←[36m# StaticPages GET /st
atic_pages works! (now write some real specs)←[0m