You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cartodb/spec/requests/http_authentication_helper.rb

27 lines
591 B

4 years ago
module HttpAuthenticationHelper
def authenticated_header
'auth_header'
end
def authentication_headers(value)
{ "#{authenticated_header}" => value }
end
def stub_http_header_authentication_configuration(field: 'email', autocreation: false, enabled: true)
Cartodb.stubs(:get_config)
config = {
'header' => authenticated_header,
'field' => field,
'autocreation' => autocreation
}
config.each do |f, v|
Cartodb.stubs(:get_config).with(:http_header_authentication, f).
returns(enabled ? v : nil)
end
config
end
end