diff options
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r-- | spec/spec_helper.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 2ddf839da..ffe48c731 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -113,9 +113,9 @@ def validate_as_body(html) "<html><head><title>Test</title></head><body>#{html}</body></html>") end -def basic_auth_login(request) - username = MySociety::Config.get('ADMIN_USERNAME') - password = MySociety::Config.get('ADMIN_PASSWORD') +def basic_auth_login(request, username = nil, password = nil) + username = MySociety::Config.get('ADMIN_USERNAME') if username.nil? + password = MySociety::Config.get('ADMIN_PASSWORD') if password.nil? request.env["HTTP_AUTHORIZATION"] = "Basic " + Base64::encode64("#{username}:#{password}") end |