Sha256: 99f192c0a967aec0e657b18633c0f7ea868d46de2f686789a9f00c344d4e253e

Contents?: true

Size: 847 Bytes

Versions: 9

Compression:

Stored size: 847 Bytes

Contents

require "action_controller"
require "action_controller/test_process"

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

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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
oauth-0.5.14 lib/oauth/oauth_test_helper.rb
oauth-0.5.13 lib/oauth/oauth_test_helper.rb
oauth-0.5.12 lib/oauth/oauth_test_helper.rb
oauth-0.5.11 lib/oauth/oauth_test_helper.rb
oauth-0.5.10 lib/oauth/oauth_test_helper.rb
oauth-0.5.9 lib/oauth/oauth_test_helper.rb
oauth-0.5.8 lib/oauth/oauth_test_helper.rb
oauth-0.5.7 lib/oauth/oauth_test_helper.rb
oauth-0.5.7.pre.pre1 lib/oauth/oauth_test_helper.rb