Created
March 20, 2009 06:59
-
-
Save roman/82256 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "ruby_openid_test_server" | |
class TestHelper < Test::Unit | |
include RubyOpenIdTestServer::ServerSpecHelper | |
# The identity on the rots server (must be the same as the one executing) | |
self.rots_config = YAML.load(<<-CONFIG | |
identity: john.doe | |
sreg: | |
nickname: jdoe | |
fullname: John Doe | |
email: jhon@doe.com | |
dob: 1985-09-21 | |
gender: M | |
CONFIG | |
) | |
# The storage of the OpenID Server (must be the same as the one executing) | |
self.rots_server_options = { | |
:storage => File.join('tmp', 'rots') | |
} | |
end | |
class OpenIDTest < TestHelper | |
def test_openid_success | |
# The rots server must be up in order to make this work | |
response = get('/', :openid_url => 'http://localhost:1123/john.doe?openid.success=true') | |
# this is the redirection to the OpenID server | |
check_id_qs = response.headers['Location'] | |
# openid_request is declared on the file lib/ruby_openid_test_server/server_spec_helper.rb | |
app_response = openid_request(check_id_qs) | |
# We do the asserts on the app_response | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment