Module: UcbRailsUser

Defined in:
lib/ucb_rails_user.rb,
lib/ucb_rails_user/engine.rb,
lib/ucb_rails_user/version.rb,
lib/ucb_rails_user/spec_helpers.rb,
app/helpers/ucb_rails_user/users_helper.rb,
app/models/ucb_rails_user/configuration/cas.rb,
app/models/ucb_rails_user/configuration/ldap.rb,
app/models/ucb_rails_user/configuration/email.rb,
app/models/ucb_rails_user/configuration/configuration.rb,
app/models/ucb_rails_user/user_session_manager/in_people_ou.rb,
app/models/ucb_rails_user/configuration/exception_notification.rb,
app/models/ucb_rails_user/user_session_manager/admin_in_user_table.rb,
app/models/ucb_rails_user/user_session_manager/active_in_user_table.rb,
app/models/ucb_rails_user/user_session_manager/test_session_manager.rb,
app/models/ucb_rails_user/user_session_manager/ldap_person_user_wrapper.rb,
app/models/ucb_rails_user/user_session_manager/in_people_ou_add_to_users_table.rb

Overview

Session manager designed to be used in tests. This bypasses the usual LDAP lookup when given a uid, and instead simply looks up the user in the current database.

This assumes that the user already exists in the database, so your test scenario should set that up before attempting a login

Defined Under Namespace

Modules: Configuration, LdapPerson, SpecHelpers, UserSessionManager, UsersHelper Classes: Engine, HomeController, SessionsController, UserLdapService, UsersController

Constant Summary collapse

VERSION =
'1.1.0'

Class Method Summary collapse

Class Method Details

.[](key) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/ucb_rails_user/engine.rb', line 14

def self.[](key)
  setting = config.send(key)

  if setting.is_a?(Proc)
    setting.call
  else
    setting
  end

rescue NameError
  Rails.logger.debug "[UcbRailsUser] Tried to access unknown UcbRailsUser.config key: #{key.inspect}"
  nil

end

.config {|Engine.config| ... } ⇒ Object

Yields:



9
10
11
12
# File 'lib/ucb_rails_user/engine.rb', line 9

def self.config(&block)
  yield Engine.config if block
  Engine.config
end

.loggerObject



16
17
18
# File 'lib/ucb_rails_user.rb', line 16

def self.logger
  Rails.logger
end