test/test_helper.rb
# Sets the current user in the session from the user fixtures.
Sets the current user in the session from the user fixtures.
Sets the current user in the session from the user fixtures .
def login_as(user, site = nil)
    user = user ? users(user) : nil
    site = sites(site || :first)
    host! site.host
    @request.session[:user] = user ? User.authenticate_for(site, user.login, 'test') : nil
    if block_given?
      yield
      reset!
    end
  end
def login_as ( user , site = nil ) user = user ? users ( user ) : nil site = sites ( site || :first ) host! site . host @request . session [ :user ] = user ? User . authenticate_for ( site , user . login , 'test' ) : nil if block_given? yield reset! end end
Sets the current user in the session from the user fixtures.
Sets the current user in the session from the user fixtures .
user
<not_specific>
site
<not_specific>