只是试图通过Michael Hartl的Ruby on Rails教程第5章的最后一部分,并得到运行RSpec测试的另一个错误。第5章 - Ruby on Rails教程 - 未定义的方法`has_title?'当运行RSpec测试
输出是:
Static pages should have the right links on the layout Failure/Error: expect(page).to have_title('About Us') NoMethodError: undefined method
has_title?' for #<Capybara::Session> # ./spec/requests/static_pages_spec.rb:59:in
block (2 levels) in '
,并从线结果,从预期(页)在下面的代码中static_pages_spec.rb:
it "should have the right links on the layout" do
visit root_path
click_link "About"
expect(page).to have_title(full_title('About Us'))
end
注:发生这种情况运行有或没有Spork
任何人都可以指向正确的方向请 ?
感谢, 巴扎