Sha256: b0ae4a67e41cf8b063aeff2ebad4f2c4c05f1a0b532041ce9b7b816dfa092ea2

Contents?: true

Size: 846 Bytes

Versions: 44

Compression:

Stored size: 846 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

44 entries across 44 versions & 18 rubygems

Version Path
greut-oauth-0.3.6 lib/oauth/oauth_test_helper.rb
jwhitmire-oauth-0.3.6.1 lib/oauth/oauth_test_helper.rb
metavida-oauth-0.3.2.1 lib/oauth/oauth_test_helper.rb
metavida-oauth-0.3.2 lib/oauth/oauth_test_helper.rb
mojodna-oauth-0.3.1.1 lib/oauth/oauth_test_helper.rb
mojodna-oauth-0.3.1.2 lib/oauth/oauth_test_helper.rb
mojodna-oauth-0.3.1.3 lib/oauth/oauth_test_helper.rb
mojodna-oauth-0.3.1.4 lib/oauth/oauth_test_helper.rb
mojodna-oauth-0.3.1.5 lib/oauth/oauth_test_helper.rb
mojodna-oauth-0.3.1.6 lib/oauth/oauth_test_helper.rb
mojodna-oauth-0.3.1.7 lib/oauth/oauth_test_helper.rb
mojodna-oauth-0.3.1.8 lib/oauth/oauth_test_helper.rb
mojodna-oauth-0.3.2.1 lib/oauth/oauth_test_helper.rb
mojodna-oauth-0.3.2.2 lib/oauth/oauth_test_helper.rb
mojodna-oauth-0.3.2 lib/oauth/oauth_test_helper.rb
mojodna-oauth-0.3.3 lib/oauth/oauth_test_helper.rb
mojodna-oauth-0.3.4.1 lib/oauth/oauth_test_helper.rb
mojodna-oauth-0.3.4 lib/oauth/oauth_test_helper.rb
mojodna-oauth-0.3.5 lib/oauth/oauth_test_helper.rb
mojodna-oauth-0.3.6 lib/oauth/oauth_test_helper.rb