X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/8bd001f1282b7a33a71c0565504e160dbe567d5d..464c7f863e8413f67b22999fd1c629969731c309:/test/test_helper.rb?ds=sidebyside diff --git a/test/test_helper.rb b/test/test_helper.rb index 7198519a7..39e8cdd05 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -85,6 +85,17 @@ module ActiveSupport @request.env["HTTP_AUTHORIZATION"] = format("Basic %{auth}", :auth => Base64.encode64("#{user}:#{pass}")) end + ## + # set oauth token permissions + def grant_oauth_token(*tokens) + request.env["oauth.token"] = AccessToken.new do |token| + tokens.each do |t| + token.public_send("#{t}=", true) + end + end + end + + ## # set request readers to ask for a particular error format def error_format(format)