Sha256: 2488ae5c08a060ec9d243377b3b3909a8106b16a0800dc5c74c997d2a8562cd1

Contents?: true

Size: 666 Bytes

Versions: 6

Compression:

Stored size: 666 Bytes

Contents

module TestHelpers
  def env_with_params(path = "/", params = {}, env = {})
    method = params.delete(:method) || "GET"
    env = { 'HTTP_VERSION' => '1.1', 'REQUEST_METHOD' => "#{method}" }.merge(env)
    Rack::MockRequest.env_for("#{path}?#{Rack::Utils.build_query(params)}", env)
  end
  
  def set_default_settings
    DeviseOam.setup do |config|
      config.oam_header = "OAM_REMOTE_USER"
      config.ldap_header = "ROLE_INFO"
      config.user_class = "User"
      config.user_login_field = "email"
      config.create_user_if_not_found = false
      config.create_user_method = "create_oam_user"
      config.roles_setter = "update_roles"
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
devise_oam-0.0.6 test/support/helpers.rb
devise_oam-0.0.5 test/support/helpers.rb
devise_oam-0.0.4 test/support/helpers.rb
devise_oam-0.0.3 test/support/helpers.rb
devise_oam-0.0.2 test/support/helpers.rb
devise_oam-0.0.1 test/support/helpers.rb