aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--spec/spec_helper.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 75a5b5603..09a808061 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -98,3 +98,9 @@ def load_test_categories
[ "other", "Miscellaneous", "miscellaneous" ],])
end
+def basic_auth_login(request, username = nil, password = nil)
+ username = Configuration::admin_username if username.nil?
+ password = Configuration::admin_password if password.nil?
+ request.env["HTTP_AUTHORIZATION"] = "Basic " + Base64::encode64("#{username}:#{password}")
+end
+