title: rspec show failure even when the condition is fulfilled
body: <p>I am using rspec to validate if a string exist in a page.  I am new to rails and following tutorial <a href="http://ruby.railstutorial.org/chapters/static-pages#top" rel="nofollow">http://ruby.railstutorial.org/chapters/static-pages#top</a>
  Is there anything I am missing? </p>
  
  <pre><code>require 'spec_helper'
  
  describe "Static pages" do
  
   describe "Home page" do
  
  it "should have the content 'Sample App'" do
    visit '/static_pages/home'
    page.should have_content('Sample App')
   end
   end
  end
  </code></pre>
  
  <p>In my home page app/views/static_pages/home.html.erb I have following code. </p>
  
  <pre><code>&lt;h1&gt;Sample App&lt;/h1&gt;
  </code></pre>
  
  <p>Command I am using to validate the condition. </p>
  
  <pre><code>bundle exec rspec spec/requests/static_pages_spec.rb
  </code></pre>
  
  <p>Test is failing don't know why. </p>
  
  <pre><code>←[31mF←[0m
  
  Failures:
  
  1) Static pages Home page should have the content 'Sample App'
   ←[31mFailure/Error:←[0m ←[31mvisit '/static_pages/home'←[0m
   ←[31mNoMethodError←[0m:
     ←[31mundefined method `visit' for #&lt;RSpec::Core::ExampleGroup::Nested_1::
   Nested_1:0x4067a60&gt;←[0m
  ←[36m     # ./spec/requests/static_pages_spec.rb:8:in `block (3 levels) in                                                                        &lt;top(required)&gt;'←[0m
  
  Finished in 0.023 seconds
  ←[31m1 example, 1 failure←[0m
  
  Failed examples:
  
  ←[31mrspec ./spec/requests/static_pages_spec.rb:7←[0m ←[36m# Static pages Home page should have the content 'Sample App'←[0m
  
  Randomized with seed 44188
  </code></pre>