Hi guys,

I am writing some performance tests and I want the user to be logged
in:

class CompaniesTest < ActionController::PerformanceTest
  fixtures :all

  def setup
    login_as(:cyrille)
  end

  def test_homepage
    get '/'
  end
end

The problem is: how should i implement login_as?

I tried:

  private
  def login_as(user)
    @request    = ActionController::TestRequest.new
    @request.session[:user] = user ? users(user).id : nil
  end

But the session[:user] is empty when it gets checked by the
application.

Obviously there must be a session object created by the
PerformanceTest, but I can't see how I am supposed to access it.

Anybody knows?

Cheers

Cyrille
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"WellRailed" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/wellrailed?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to