Mercurial > hg > soundsoftware-site
comparison lib/plugins/open_id_authentication/test/normalize_test.rb @ 1115:433d4f72a19b redmine-2.2
Update to Redmine SVN revision 11137 on 2.2-stable branch
author | Chris Cannam |
---|---|
date | Mon, 07 Jan 2013 12:01:42 +0000 |
parents | vendor/plugins/open_id_authentication/test/normalize_test.rb@513646585e45 |
children |
comparison
equal
deleted
inserted
replaced
929:5f33065ddc4b | 1115:433d4f72a19b |
---|---|
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 |