我正试图在http://railstutorial.org上关注壮观的Rails3教程,但在第5章遇到了问题。
多么具有讽刺意味,但我正在运行这些LayoutLinks(http://railstutorial.org/chapters/filling-in-the-layout#sec:integration_tests)规范的堆栈溢出。
这是输出:
C:\sample_app>rspec spec\requests\layout_links_spec.rb
FFFFFF
Failures:
1) LayoutLinks should have a Home page at '/'
Failure/Error: response.should have_selector('title', :content => "Home")
stack level too deep
# ./spec/requests/layout_links_spec.rb:7
2) LayoutLinks should have a Contact page at '/contact'
Failure/Error: response.should have_selector('title', :content => "Contact")
stack level too deep
# ./spec/requests/layout_links_spec.rb:12
3) LayoutLinks should have an About page at '/about'
Failure/Error: response.should have_selector('title', :content => "About")
stack level too deep
# ./spec/requests/layout_links_spec.rb:17
4) LayoutLinks should have a Help page at '/help'
Failure/Error: response.should have_selector('title', :content => "Help")
stack level too deep
# ./spec/requests/layout_links_spec.rb:22
5) LayoutLinks should have a Help page at '/help'
Failure/Error: response.should have_selector('title', :content => "Help")
stack level too deep
# ./spec/requests/layout_links_spec.rb:27
6) LayoutLinks should have a signup page at '/signup'
Failure/Error: response.should have_selector('title', :content => "Sign up")
stack level too deep
# ./spec/requests/layout_links_spec.rb:32
Finished in 206.38 seconds
6 examples, 6 failures
代码和规格应与该教程相同(我复制粘贴)。
任何想法可能会发生在这里?
我尝试使用-b运行规范以获得更多堆栈跟踪,但由于某种原因它无效。
我在Windows 7上使用Ruby 1.8.7,Rails 3.0.1和RSpec 2.1.0。
答案 0 :(得分:2)
好像你遇到了这个Webrat问题:https://github.com/rspec/rspec-rails/issues#issue/140。
尝试降级到gemfile中的Webrat 0.7.1。