Capybara 2.0.0.beta4有未定义的路径

TKA*_*KAB 5 capybara rspec-rails ruby-on-rails-3

我刚刚使用rspec-rails 2.11.4升级到Capybara 2.0.0.beta4并按照Capybara -Readme的spec/features建议移动了我的请求规范(我只有一个)按照RSpec-Rails存储库中的Capybara-.当我现在运行测试时,它找不到任何路径.因此对于以下测试块:

it "should be able to access the signup page through the front page" do
  visit root_path
  click_link "Signup For Free Now"
  page.should have_content("Signup")
end
Run Code Online (Sandbox Code Playgroud)

我收到错误消息:

Failure/Error: visit root_path
NameError: undefined local variable or method `root_path' for #<RSpec...>
Run Code Online (Sandbox Code Playgroud)

当我尝试运行测试时visit "/"它工作正常.其他宝石版本是:

  • 轨道3.2.1
  • rspec 2.11.0
  • 机架测试0.6.2

任何有关路径问题的原因的想法?

小智 11

运行"bundle update rspec-rails"来获取版本2.12.0为我解决了同样的问题.