Michael Hartl's Ruby on Rails tutorial failed test Chapter 8
===

I'm new on Rails. I'm following the tutorial of Michael Hartl, Ruby on Rails Tutorial - Learn Web Development with Rails (http://ruby.railstutorial.org/). I've found an error when I try to pass some tests. My output when I execute *bundle exec rspec* is the next:

<pre>
.........................................F.....

Failures:

  1) Authentication signin with invalid information 
     Failure/Error: it { should have_selector('div.alert.alert-error', text: 'Invalid') }
       expected css "div.alert.alert-error" with text "Invalid" to return something
     # ./spec/requests/authentication_pages_spec.rb:23:in `block (4 levels) in <top (required)>'

Finished in 1.39 seconds
47 examples, 1 failure

Failed examples:

rspec ./spec/requests/authentication_pages_spec.rb:23 # Authentication signin with invalid information 
</pre>

The files that have been more highly changed and may be causing this are next:

**authentication_pages_rspec.rb**

<pre>
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

    describe "with valid information" do
      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
end
</pre>

**sessions_controler.rb**

<pre>
class SessionsController < ApplicationController

	def new
	end
	
  def create
    user = User.find_by_email(params[:session][:email])
    if user && user.authenticate(params[:session][:password])
      sign_in user
      redirect_to user
    else
      flash.now[:error] = 'Invalid email/password combination'
      render 'new'
    end
  end
	
	def destroy
	end
end
</pre>

**sessions_helper.rb**

<pre>

module SessionsHelper

	def sign_in(user)
		cookies.permanent[:remember_token] = user.remember_token
		self.current_user = user;
	end
	
	def signed_in?
		!current_user.nil?
	end
	
	def current_user=(user)
		@current_user = user
	end
	
	def current_user
		@current_user ||= User.find_by_remember_token(cookies[:remember_token])
	end
end
</pre>

If you need any other file, please let me know and I'll post it. Thank you in advance.
