title: why is this spec failing when it should be passing?
body: <p>I'm getting this error with rspec.However, the code should be passing. All the selectors Rspec is complaining about exists.</p>
  
  <pre><code>FF.FFFFFF
  
  Failures:
  
    1) StaticPages Home page should have the h1 'Sample App'
       Failure/Error: page.should have_selector('h1', text:  'Sample App')
         expected css "h1" with text "Sample App" to return something
       # ./spec/requests/static_pages_spec.rb:9:in `block (3 levels) in &lt;top (required)&gt;'
  
    2) StaticPages Home page should have the base title
       Failure/Error: page.should have_selector('title', text:  "Ruby on Rails Tutorial Sample App")
         expected css "title" with text "Ruby on Rails Tutorial Sample App" to return something
       # ./spec/requests/static_pages_spec.rb:14:in `block (3 levels) in &lt;top (required)&gt;'
  
    3) StaticPages Help page should have the h1  'Help'
       Failure/Error: page.should have_selector('h1',text:  "Help")
         expected css "h1" with text "Help" to return something
       # ./spec/requests/static_pages_spec.rb:28:in `block (3 levels) in &lt;top (required)&gt;'
  
    4) StaticPages Help page should have the title 'Help'
       Failure/Error: page.should have_selector('title', text:  "Ruby on Rails Tutorial Sample App | Help")
         expected css "title" with text "Ruby on Rails Tutorial Sample App | Help" to return something
       # ./spec/requests/static_pages_spec.rb:33:in `block (3 levels) in &lt;top (required)&gt;'
  
    5) StaticPages About page should have the h1 'About us' 
       Failure/Error: page.should have_selector('h1', text:  'About Us')
         expected css "h1" with text "About Us" to return something
       # ./spec/requests/static_pages_spec.rb:41:in `block (3 levels) in &lt;top (required)&gt;'
  
    6) StaticPages About page should have the title 'About Us'
       Failure/Error: page.should have_selector('title', text:  "Ruby on Rails Tutorial Sample App | About Us")
         expected css "title" with text "Ruby on Rails Tutorial Sample App | About Us" to return something
       # ./spec/requests/static_pages_spec.rb:46:in `block (3 levels) in &lt;top (required)&gt;'
  
    7) StaticPages Contact pages should have the h1 'Contact'
       Failure/Error: page.should have_selector('h1', text:  'Contact')
         expected css "h1" with text "Contact" to return something
       # ./spec/requests/static_pages_spec.rb:53:in `block (3 levels) in &lt;top (required)&gt;'
  
    8) StaticPages Contact pages Should have the title page 'Contact'
       Failure/Error: page.should have_selector('title',
         expected css "title" with text "Ruby on Rails Tutorial Sample App | Contact" to return something
       # ./spec/requests/static_pages_spec.rb:59:in `block (3 levels) in &lt;top (required)&gt;'
  
  Finished in 0.31051 seconds
  9 examples, 8 failures
  
  Failed examples:
  
  rspec ./spec/requests/static_pages_spec.rb:7 # StaticPages Home page should have the h1 'Sample App'
  rspec ./spec/requests/static_pages_spec.rb:12 # StaticPages Home page should have the base title
  rspec ./spec/requests/static_pages_spec.rb:26 # StaticPages Help page should have the h1  'Help'
  rspec ./spec/requests/static_pages_spec.rb:31 # StaticPages Help page should have the title 'Help'
  rspec ./spec/requests/static_pages_spec.rb:39 # StaticPages About page should have the h1 'About us' 
  rspec ./spec/requests/static_pages_spec.rb:44 # StaticPages About page should have the title 'About Us'
  rspec ./spec/requests/static_pages_spec.rb:51 # StaticPages Contact pages should have the h1 'Contact'
  rspec ./spec/requests/static_pages_spec.rb:56 # StaticPages Contact pages Should have the title page 'Contact'
  </code></pre>
  
  <p>Here are the specs</p>
  
  <pre><code>require 'spec_helper'
  
  describe "StaticPages" do
  
    describe "Home page" do
  
      it "should have the h1 'Sample App'" do
       get '/static_pages/home'
        page.should have_selector('h1', text:  'Sample App')
      end
  
      it "should have the base title" do
        get '/static_pages/home'
        page.should have_selector('title', text:  "Ruby on Rails Tutorial Sample App")
      end
  
      it "should not havea custom page title " do
        get '/static_pages/home'
        page.should_not have_selector('title', text:  '| Home')
      end
    end
    #end home page spec
  
    describe "Help page" do
  
      it "should have the h1  'Help'" do
        get '/static_pages/help'
        page.should have_selector('h1',text:  "Help")
      end
  
      it "should have the title 'Help'" do
        get '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
        get '/static_pages/about'
        page.should have_selector('h1', text:  'About Us')
      end
  
      it "should have the title 'About Us'" do
        get '/static_pages/about'
        page.should have_selector('title', text:  "Ruby on Rails Tutorial Sample App | About Us")
      end
    end
  
    describe "Contact pages" do
      it "should have the h1 'Contact'" do
        get '/static_pages/contact'
        page.should have_selector('h1', text:  'Contact')
      end
  
      it "Should have the title page 'Contact'" do
        get '/static_pages/contact'
        #this test is passing but the code in the book is not the same as what is below
        page.should have_selector('title',
                                      text:  "Ruby on Rails Tutorial Sample App | Contact")
      end
    end
  end
  </code></pre>
  
  <p>The home.html.erb view</p>
  
  <pre><code>&lt;div&gt; 
    &lt;h1&gt;Welcome to the Sample App&lt;/h1&gt;
      &lt;h2&gt;This is the home page for the
        &lt;a href="http://railstutorial.org"&gt;Ruby on Rails Tutorial&lt;/a&gt;
        sample application
      &lt;h2&gt;
        &lt;%= link_to "Sign up now!", '#', class: "btn btn-large btn-primary"%&gt;
   &lt;/div&gt; 
  
   &lt;%= link_to image_tag("rails.png", alt:  "Rails"), 'http://rubyonrails.org' %&gt;
  </code></pre>
  
  <p>the contact.html.erb</p>
  
  <pre><code>&lt;% provide(:title, 'Contact' ) %&gt;
  &lt;h1&gt;Contact&lt;/h1&gt;
  &lt;p&gt;
    Contact Ruby on rails tutorial about he sample app at the 
    &lt;a href="http://railstutorial.org/contact"&gt;contact page&lt;/a&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>The about.html.erb</p>
  
  <pre><code>&lt;% provide(:title,'About Us') %&gt;
    &lt;h1&gt;About Us&lt;/h1&gt;
    &lt;p&gt;
      &lt;a href="http://railstutorial.orb"&gt;Ruby on Rails Tutorial&lt;/a&gt;
      is a project to make a book and screencasts to teach web development 
      &lt;a href="http://rubyonrails.org"&gt;Ruby on Rails&lt;/a&gt; This
      is the sampel app for the tutorial
    &lt;/p&gt;
  </code></pre>