I have this login scheme in my application.rb controller that looks like this: (pretty must straight from the rails recipes book):
def check_authorization @user=User.find(session[:user])
unless @user.roles.detect {|role| role.rights.detect{|right| right.action == action_name && right.controller == self.class.controller_path } }
render :text => "You are not authroized to preform this action", :status => 403 return false end end
This works fine, but It makes it hard for me to functional test my controllers. Because now when I run my functional tests they all fail with 403 authentication errors.
How can I login on my functional tests ?