【发布时间】:2014-06-29 15:13:29
【问题描述】:
我有:
已将
gem 'capybara'添加到我的Gemfile并运行bundle已将我的规范作为
visit_home_page_root_spec.rb 放入规范/请求中
已添加到 `spec/spec_helper.rb:
-
require 'rspec/rails'
require 'rspec/autorun'
require 'capybara/rails'
require 'capybara/rspec'
但我仍然收到标题中显示的消息。
我的规格是:
describe "Home Page", :type => :feature do
it "Visit the home page" do
visit '/'
expect(page).to have_content 'Linker'
end
end
Gemfile.lock 有:
rspec-core (2.14.8)
rspec-expectations (2.14.5)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.6)
rspec-rails (2.14.1)
actionpack (>= 3.0)
activemodel (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec-core (~> 2.14.0)
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
【问题讨论】:
-
是的:gem "rspec-rails", "~> 2.0" 这是 rspec 3.x 我相信
-
不应该 - 实际解析的版本是什么(如果您使用的是捆绑程序,请检查 Gemfile.lock)
-
从我的 Gemfile.lock 添加 rspec 信息
-
我的 Gemfile 有
gem "rspec-rails", "~> 2.0"也许我应该删除 2.0 版本并尝试运行它们。 -
我试过了,做了捆绑安装,然后运行测试,我得到了同样的错误。
标签: ruby-on-rails ruby-on-rails-3 rspec capybara rspec2