Create a Functional Test for Session Controller

Does anybody know how to make a functional test for this controller :

  def create
    user = User.authenticate(params[:email], params[:password])
    if user
      session[:user_id] =
      redirect_to root_url, :notice => "Logged in!"
    else = "Invalid email or password"
      render "new"

  def destroy
    session[:user_id] = nil
    redirect_to root_url, :notice => "Logged out!"

I am so confused, because i am a newbie to ROR, please help me,

Have you worked right through a good tutorial such as (which is free to use online)? This includes a good
introduction to testing.


And the answer his dont re-invent the wheel, look at something called devise.