comparison .svn/pristine/01/0171e251406a6b1885f3fa9813dc6f97a4ee7ea8.svn-base @ 909:cbb26bc654de redmine-1.3

Update to Redmine 1.3-stable branch (Redmine SVN rev 8964)
author Chris Cannam
date Fri, 24 Feb 2012 19:09:32 +0000
parents
children
comparison
equal deleted inserted replaced
908:c6c2cbd0afee 909:cbb26bc654de
1 require File.dirname(__FILE__) + '/test_helper'
2
3 class NormalizeTest < Test::Unit::TestCase
4 include OpenIdAuthentication
5
6 NORMALIZATIONS = {
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/",
20 "=name" => "=name"
21 }
22
23 def test_normalizations
24 NORMALIZATIONS.each do |from, to|
25 assert_equal to, normalize_identifier(from)
26 end
27 end
28
29 def test_broken_open_id
30 assert_raises(InvalidOpenId) { normalize_identifier(nil) }
31 end
32 end