title: Ruby on Rails Tutorial Chapter 5 Failure/Error it {should have_selector
body: <p>I'm working on the Ruby on Rails Tutorial (chapter 5) and I'm getting an error.  My code is at....</p>
  
  <p><a href="https://github.com/Hjack/sample_app_new" rel="nofollow">https://github.com/Hjack/sample_app_new</a></p>
  
  <p>I'm getting the following error...</p>
  
  <pre><code>hakimus-MacBook-Air:sample_app_new hakimujackson$ bundle exec rspec spec/requests/static_pages_spec.rb
  Rack::File headers parameter replaces cache_control after Rack 1.5.
  ...FFFFFF
  
  Failures:
  
    1) Help page
       Failure/Error: it { should have_selector('h1',   text: 'Help')}
         expected css "h1" with text "Help" to return something
       # ./spec/requests/static_pages_spec.rb:20:in `block (2 levels) in &lt;top (required)&gt;'
  
    2) Help page
       Failure/Error: it { should have_selector('title', text: full_title('Help'))}
         expected css "title" with text "Ruby on Rails Tutorial Sample App | Help" to return something
       # ./spec/requests/static_pages_spec.rb:21:in `block (2 levels) in &lt;top (required)&gt;'
  
    3) About page
       Failure/Error: it { should have_selector('h1',  text: 'About')}
         expected css "h1" with text "About" to return something
       # ./spec/requests/static_pages_spec.rb:28:in `block (2 levels) in &lt;top (required)&gt;'
  
    4) About page
       Failure/Error: it { should have_selector('title', text: full_title('About Us'))}
         expected css "title" with text "Ruby on Rails Tutorial Sample App | About Us" to return something
       # ./spec/requests/static_pages_spec.rb:29:in `block (2 levels) in &lt;top (required)&gt;'
  
    5) Contact page
       Failure/Error: it { should have_selector('h1',   text: 'Contact')}
         expected css "h1" with text "Contact" to return something
       # ./spec/requests/static_pages_spec.rb:36:in `block (2 levels) in &lt;top (required)&gt;'
  
    6) Contact page
       Failure/Error: it { should have_selector('title',  text: full_title('Contact'))}
         expected css "title" with text "Ruby on Rails Tutorial Sample App | Contact" to return something
       # ./spec/requests/static_pages_spec.rb:37:in `block (2 levels) in &lt;top (required)&gt;'
  
  Finished in 0.21916 seconds
  9 examples, 6 failures
  
  Failed examples:
  
  rspec ./spec/requests/static_pages_spec.rb:20 # Help page
  rspec ./spec/requests/static_pages_spec.rb:21 # Help page
  rspec ./spec/requests/static_pages_spec.rb:28 # About page
  rspec ./spec/requests/static_pages_spec.rb:29 # About page
  rspec ./spec/requests/static_pages_spec.rb:36 # Contact page
  rspec ./spec/requests/static_pages_spec.rb:37 # Contact page
  </code></pre>
  
  <p>Here is my spec.rb file...</p>
  
  <pre><code>require 'spec_helper'
  
  describe "StaticPages" do
  
      subject { page }
  
    describe "Home page" do
  
      before { visit root_path }
  
      it { should have_selector('h1',  text: 'Sample App')}
      it { should have_selector('title', text: full_title(''))}
      it { should_not have_selector 'title', text: '| Home'}
      end
    end
  
    describe "Help page" do
      before { visit help_path }
  
      it { should have_selector('h1',   text: 'Help')}
      it { should have_selector('title', text: full_title('Help'))}
      end
  
  
    describe "About page" do
      before { visit about_path }
  
      it { should have_selector('h1',  text: 'About')}
      it { should have_selector('title', text: full_title('About Us'))}
      end
  
  
    describe "Contact page" do
      before { visit contact_path}
  
      it { should have_selector('h1',   text: 'Contact')}
      it { should have_selector('title',  text: full_title('Contact'))}
      end
  </code></pre>
  
  <p>I'm not sure what I'm doing wrong.  I'd appreciate any help.</p>
  
  <p>Thanks!!!</p>