Тест заголовка не удался для спецификации запроса в учебнике Майкла Хартла для Rails 3

Я следую учебному пособию по Ruby On Rails 3 Майкла Хартла и использую Capybara для спецификаций интеграции. Спецификации интеграции пока следующие

require 'spec_helper'

describe "StaticPages" do
  describe "Home page" do
    it "should have the h1 'Sample App'" do
      visit '/static_pages/home'
      page.should have_selector('h1',:text => 'Sample App')
    end

    it "should have the title 'Home'" do
      visit '/static_pages/home'
      page.should have_selector('title',:text => "Ruby on Rails Tutorial Sample App | Home")
    end
  end

  describe "Help page" do
    it "should have the h1 'Help'" do
      visit '/static_pages/help'
      page.should have_selector('h1',:text => 'Help')
    end

    it "should have the title 'Help'" do
      visit '/static_pages/help'
      page.should have_selector('title',:text => "Ruby on Rails Tutorial Sample App | Help")
    end
  end

  describe "About page" do
    it "should have the h1 'About Us'" do
      visit '/static_pages/about'
      page.should have_selector('h1',:text => 'About Us')
    end

    it "should have the title 'About'" do
      visit '/static_pages/about'
      page.should have_selector('title',:text => "Ruby on Rails Tutorial Sample App | About Us")
    end
  end
end

Когда я запускаю эти тесты, я получаю:

 1) StaticPages Home page should have the title 'Home'
     Failure/Error: page.should have_selector('title',:text => "Ruby on Rails Tutorial Sample App | Home")
       expected #has_selector?("title") to return true, got false
     # ./spec/requests/static_pages_spec.rb:12:in `block (3 levels) in <top (required)>'

  2) StaticPages Help page should have the title 'Help'
     Failure/Error: page.should have_selector('title',:text => "Ruby on Rails Tutorial Sample App | Help")
       expected #has_selector?("title") to return true, got false
     # ./spec/requests/static_pages_spec.rb:24:in `block (3 levels) in <top (required)>'

  3) StaticPages About page should have the title 'About'
     Failure/Error: page.should have_selector('title',:text => "Ruby on Rails Tutorial Sample App | About Us")
       expected #has_selector?("title") to return true, got false
     # ./spec/requests/static_pages_spec.rb:36:in `block (3 levels) in <top (required)>'

Я ожидаю, что тест заголовка для справки и о странице потерпит неудачу, но мой home.html.erb выглядит следующим образом

<html>
<head>
  <title>Ruby on Rails Tutorial Sample App | Home</title>
</head>
<body>
<h1>Sample App</h1>
<p>
This is the homepage for the sample app
</p>
</body>
</html>

Кроме того, я вижу заголовок «Образец приложения Ruby on Rails Tutorial | Домой 'on' / static_pages / home '. Что является причиной провала титульного теста для дома?

Ответы на вопрос(2)

Ваш ответ на вопрос