Module: Sorcery::TestHelpers::Rails

Included in:
Internal::Rails
Defined in:
lib/sorcery/test_helpers/rails.rb

Instance Method Summary collapse

Instance Method Details

#login_user(user = nil) ⇒ Object

logins a user and calls all callbacks



5
6
7
8
9
# File 'lib/sorcery/test_helpers/rails.rb', line 5

def (user = nil)
  user ||= @user
  @controller.send(:auto_login,user)
  @controller.send(:after_login!,user,[user.send(user.sorcery_config.username_attribute_names.first),'secret'])
end

#logout_userObject



11
12
13
# File 'lib/sorcery/test_helpers/rails.rb', line 11

def logout_user
  @controller.send(:logout)
end