Module: OAuth::OAuthTestHelper

Defined in:
lib/oauth/oauth_test_helper.rb

Instance Method Summary collapse

Instance Method Details

#mock_incoming_request_with_authorize_header(request) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/oauth/oauth_test_helper.rb', line 13

def mock_incoming_request_with_authorize_header(request)
  incoming=ActionController::TestRequest.new
  incoming.env["HTTP_AUTHORIZATION"]=request.to_auth_string
  incoming.request_uri=request.path
  incoming.env["SERVER_PORT"]=request.uri.port
  incoming.host=request.uri.host
  incoming.env['REQUEST_METHOD']=request.http_method
  incoming
end

#mock_incoming_request_with_query(request) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/oauth/oauth_test_helper.rb', line 4

def mock_incoming_request_with_query(request)
  incoming=ActionController::TestRequest.new(request.to_hash)
  incoming.request_uri=request.path
  incoming.env["SERVER_PORT"]=request.uri.port
  incoming.host=request.uri.host
  incoming.env['REQUEST_METHOD']=request.http_method
  incoming
end