title: Capybara::ElementNotFound: Error
body: <p>i am following railstutorial.org tutorial i am getting the following error</p>
  
  <pre><code>  1) User pages signup with valid information should create a user
       Failure/Error: fill_in "password" , with: "foobar"
       Capybara::ElementNotFound:
         cannot fill in, no text field, text area or password field with id, name, or label 'password' found
       # (eval):2:in `fill_in'
       # ./spec/requests/user_pages_spec.rb:32:in `block (4 levels) in &lt;top (required)&gt;'
  
    2) Authentication signin with invalid information 
       Failure/Error: before { click_button "Sign in" }
       Capybara::ElementNotFound:
         no button with value or id or text 'Sign in' found
       # (eval):2:in `click_button'
       # ./spec/requests/authentication_pages_spec.rb:14:in `block (4 levels) in &lt;top (required)&gt;'
  
    3) Authentication signin with invalid information 
       Failure/Error: before { click_button "Sign in" }
       Capybara::ElementNotFound:
         no button with value or id or text 'Sign in' found
       # (eval):2:in `click_button'
       # ./spec/requests/authentication_pages_spec.rb:14:in `block (4 levels) in &lt;top (required)&gt;'
  
    4) Authentication signin with invalid information after visiting another page 
       Failure/Error: before { click_button "Sign in" }
       Capybara::ElementNotFound:
         no button with value or id or text 'Sign in' found
       # (eval):2:in `click_button'
       # ./spec/requests/authentication_pages_spec.rb:14:in `block (4 levels) in &lt;top (required)&gt;'
  
  Finished in 3.67 seconds
  46 examples, 4 failures
  </code></pre>
  
  <p>and my authentication_pages_spec.rb</p>
  
  <pre><code>require 'spec_helper'
  
  describe "Authentication" do
  
    subject { page }
  
    describe "signin page" do
      before { visit signin_path }
      it { should have_selector('h1', text: 'Sign in') }
      it { should have_selector('title', text: 'Sign in') }
    end
  
    describe "signin" do
      before { visit signin_path }
      describe "with invalid information" do
        before { click_button "Sign in" }
        it { should have_selector('title', text: 'Sign in') }
        it { should have_selector('div.alert.alert-error', text: 'Invalid') }
        describe "after visiting another page" do
          before { click_link "Home" }
          it { should_not have_selector('div.alert.alert-error') }
        end
      end
  
  
      let(:user) { FactoryGirl.create(:user) }
      before do
        fill_in "Email", with: user.email
        fill_in "Password", with: user.password
        click_button "Sign in"
      end
  
      it{should have_selector('title', text: user.name) }
      it{should have_link('Profile', href:user_path(user))}
      it{should have_link('Sign out',href: signout_path)}
      it{should_not have_link('Sign in',href: signin_path)}
    end
  end 
  </code></pre>
  
  <p>and app/view/sessions/new.html.erb</p>
  
  <pre><code>&lt;% provide(:title, "Sign in") %&gt;
  &lt;h1&gt;Sign in&lt;/h1&gt;
  &lt;div class="row"&gt;
    &lt;div class="span6 offset3"&gt;
      &lt;%= form_for(:session, url: sessions_path) do |f| %&gt;
        &lt;%= f.label :email %&gt;
        &lt;%= f.text_field :email %&gt;
        &lt;%= f.label :password %&gt;
        &lt;%= f.password_field :password %&gt;
        &lt;%= f.submit "Sign in", class: "btn btn-large btn-primary" %&gt;
      &lt;% end %&gt;
      &lt;p&gt;New user? &lt;%= link_to "Sign up now!", signup_path %&gt;&lt;/p&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>