1 require File.dirname(__FILE__) + '/test_helper'
3 class NormalizeTest < Test::Unit::TestCase
4 include OpenIdAuthentication
7 "openid.aol.com/nextangler" => "http://openid.aol.com/nextangler",
8 "http://openid.aol.com/nextangler" => "http://openid.aol.com/nextangler",
9 "https://openid.aol.com/nextangler" => "https://openid.aol.com/nextangler",
10 "HTTP://OPENID.AOL.COM/NEXTANGLER" => "http://openid.aol.com/NEXTANGLER",
11 "HTTPS://OPENID.AOL.COM/NEXTANGLER" => "https://openid.aol.com/NEXTANGLER",
12 "loudthinking.com" => "http://loudthinking.com/",
13 "http://loudthinking.com" => "http://loudthinking.com/",
14 "http://loudthinking.com:80" => "http://loudthinking.com/",
15 "https://loudthinking.com:443" => "https://loudthinking.com/",
16 "http://loudthinking.com:8080" => "http://loudthinking.com:8080/",
17 "techno-weenie.net" => "http://techno-weenie.net/",
18 "http://techno-weenie.net" => "http://techno-weenie.net/",
19 "http://techno-weenie.net " => "http://techno-weenie.net/",
23 def test_normalizations
24 NORMALIZATIONS.each do |from, to|
25 assert_equal to, normalize_identifier(from)
29 def test_broken_open_id
30 assert_raises(InvalidOpenId) { normalize_identifier(nil) }