私はここでレールのチュートリアルに従っています:http://railstutorial.org/chapters/filling-in-the-layout#top
「rspecspec/」を実行すると、次のようなエラーが発生します。
1) LayoutLinks should have a Home page at '/'
Failure/Error: Unable to find matching line from backtrace
stack level too deep
# C:/Ruby19/lib/ruby/1.9.1/forwardable.rb:185
2) LayoutLinks should have a Contact page at '/contact'
Failure/Error: Unable to find matching line from backtrace
stack level too deep
# C:/Ruby19/lib/ruby/1.9.1/forwardable.rb:185
しかし、Webブラウザでlocalhost:3000 /およびlocalhost:3000 / contactに移動すると、ページが表示され、正しいタイトルが表示されます。これが私のmyrailsroot\spec \ requests\layout_links_spec.rbファイルです。
require 'spec_helper'
describe "LayoutLinks" do
it "should have a Home page at '/'" do
get '/'
response.should have_selector('title', :content => "Home")
end
it "should have a Contact page at '/contact'" do
get '/contact'
response.should have_selector('title', :content => "Contact")
end
it "should have an About page at '/about'" do
get '/about'
response.should have_selector('title', :content => "About")
end
it "should have a Help page at '/help'" do
get '/help'
response.should have_selector('title', :content => "Help")
end
it "should have a signup page at '/signup'" do
get '/signup'
response.should have_selector('title', :content => "Sign up")
end
end
どんなアイデアでも素晴らしいでしょう、ありがとう