Convert OpenID authentication to use OmniAuth
[rails.git] / vendor / gems / rots-0.2.1 / lib / rots / test_helper.rb
1 require "openid/consumer"
2 require "openid/consumer/checkid_request.rb"
3 require "net/http"
4
5 module Rots::TestHelper
6   
7   def openid_request(openid_request_uri)
8     openid_response = Net::HTTP.get_response(URI.parse(openid_request_uri))
9     openid_response_uri = URI(openid_response['Location'])
10     openid_response_qs = Rack::Utils.parse_query(openid_response_uri.query)
11     
12     { :url => openid_response_uri.to_s,
13       :query_params => openid_response_qs }
14   end
15   
16 end