Sha256: ffb98f1e8f0de422ec619bb4fd6936248fd18be77764e5db23a7f92a4793d85f

Contents?: true

Size: 847 Bytes

Versions: 28

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

28 entries across 25 versions & 7 rubygems

Version Path
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/oauth-0.5.6/lib/oauth/oauth_test_helper.rb
oauth-0.5.6 lib/oauth/oauth_test_helper.rb
oauth-0.5.5 lib/oauth/oauth_test_helper.rb
tdiary-5.0.8 vendor/bundle/gems/oauth-0.5.4/lib/oauth/oauth_test_helper.rb
oauth-0.5.4 lib/oauth/oauth_test_helper.rb
tdiary-5.0.5 vendor/bundle/gems/oauth-0.5.3/lib/oauth/oauth_test_helper.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/oauth-0.5.1/lib/oauth/oauth_test_helper.rb
tdiary-5.0.5 vendor/bundle/gems/oauth-0.5.1/lib/oauth/oauth_test_helper.rb
oauth-0.5.3 lib/oauth/oauth_test_helper.rb
oauth-0.5.2 lib/oauth/oauth_test_helper.rb
tdiary-5.0.4 vendor/bundle/gems/oauth-0.5.1/lib/oauth/oauth_test_helper.rb
oauth-0.5.1 lib/oauth/oauth_test_helper.rb
oauth-0.5.0 lib/oauth/oauth_test_helper.rb
tdiary-4.2.1 vendor/bundle/ruby/2.3.0/gems/oauth-0.4.7/lib/oauth/oauth_test_helper.rb
tdiary-4.2.1 vendor/bundle/ruby/2.2.0/gems/oauth-0.4.7/lib/oauth/oauth_test_helper.rb
oauth-ap-0.4.8 lib/oauth/oauth_test_helper.rb
oauth-instructure-0.4.10 lib/oauth/oauth_test_helper.rb
oauth_weshays-0.4.8.pre2 lib/oauth/oauth_test_helper.rb
oauth_weshays-0.4.8.pre lib/oauth/oauth_test_helper.rb
oauth-instructure-0.4.9 lib/oauth/oauth_test_helper.rb