sqm-dashboards/spec/support/basic_auth_helper.rb
2021-10-26 15:05:30 -04:00

7 lines
243 B
Ruby

module BasicAuthHelper
def login_as(district)
user = district.name.downcase
pw = "#{district.name.downcase}!"
request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(user, pw)
end
end