sqm-dashboards/spec/support/basic_auth_helper.rb
2023-03-21 16:16:07 -07:00

7 lines
222 B
Ruby

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