]> git.openstreetmap.org Git - rails.git/blobdiff - test/test_helper.rb
Add tests for OAuth2
[rails.git] / test / test_helper.rb
index a6147ef29054e817dbe27d7cd9b3c5a146dcf6a6..505fa256876b2a9000965d59fda9923b67f6580d 100644 (file)
@@ -138,6 +138,12 @@ module ActiveSupport
       { "Authorization" => format("Basic %<auth>s", :auth => Base64.encode64("#{user}:#{pass}")) }
     end
 
+    ##
+    # return request header for HTTP Bearer Authorization
+    def bearer_authorization_header(token)
+      { "Authorization" => "Bearer #{token}" }
+    end
+
     ##
     # make an OAuth signed request
     def signed_request(method, uri, options = {})