test/test_helper.rb
# Logs in a test user.
Logs in a test user.
Logs in a test user .
def log_in_as(user, options = {})
    password    = options[:password]    || 'password'
    remember_me = options[:remember_me] || '1'
    if integration_test?
      post login_path, session: { email:       user.email,
                                  password:    password,
                                  remember_me: remember_me }
    else
      session[:user_id] = user.id 
    end
  end
def log_in_as ( user , options = { } ) password = options [ :password ] || 'password' remember_me = options [ :remember_me ] || '1' if integration_test? post login_path , session : { email : user . email , password : password , remember_me : remember_me } else session [ :user_id ] = user . id end end
Logs in a test user.
Logs in a test user .
user
<not_specific>
options
<not_specific>