I have a simple controller:
class AccessController < ApplicationController
if request.post? employee = Employee.authenticate(params[:name], params[:password]) if employee session[:employee_id] = employee.id redirect_to(:controller => "timesheets", :action => "index") else flash.now[:notice] = "Invalid username/password combination" end end
I have tried a number of ways to create a spec to test the login
but am not having any luck.
My current code looks something like this, but I don’t really understand
what is going on here.
post :login, params
I am setting a simple expectation in the first line and then doing a
I then check to see if the variable is in the session.
What is the best way to make something like this work…
Wayne L. Andersen