annotate .svn/pristine/01/0171e251406a6b1885f3fa9813dc6f97a4ee7ea8.svn-base @ 1519:afce8026aaeb redmine-2.4-integration

Merge from branch "live"
author Chris Cannam
date Tue, 09 Sep 2014 09:34:53 +0100
parents cbb26bc654de
children
rev   line source
Chris@909 1 require File.dirname(__FILE__) + '/test_helper'
Chris@909 2
Chris@909 3 class NormalizeTest < Test::Unit::TestCase
Chris@909 4 include OpenIdAuthentication
Chris@909 5
Chris@909 6 NORMALIZATIONS = {
Chris@909 7 "openid.aol.com/nextangler" => "http://openid.aol.com/nextangler",
Chris@909 8 "http://openid.aol.com/nextangler" => "http://openid.aol.com/nextangler",
Chris@909 9 "https://openid.aol.com/nextangler" => "https://openid.aol.com/nextangler",
Chris@909 10 "HTTP://OPENID.AOL.COM/NEXTANGLER" => "http://openid.aol.com/NEXTANGLER",
Chris@909 11 "HTTPS://OPENID.AOL.COM/NEXTANGLER" => "https://openid.aol.com/NEXTANGLER",
Chris@909 12 "loudthinking.com" => "http://loudthinking.com/",
Chris@909 13 "http://loudthinking.com" => "http://loudthinking.com/",
Chris@909 14 "http://loudthinking.com:80" => "http://loudthinking.com/",
Chris@909 15 "https://loudthinking.com:443" => "https://loudthinking.com/",
Chris@909 16 "http://loudthinking.com:8080" => "http://loudthinking.com:8080/",
Chris@909 17 "techno-weenie.net" => "http://techno-weenie.net/",
Chris@909 18 "http://techno-weenie.net" => "http://techno-weenie.net/",
Chris@909 19 "http://techno-weenie.net " => "http://techno-weenie.net/",
Chris@909 20 "=name" => "=name"
Chris@909 21 }
Chris@909 22
Chris@909 23 def test_normalizations
Chris@909 24 NORMALIZATIONS.each do |from, to|
Chris@909 25 assert_equal to, normalize_identifier(from)
Chris@909 26 end
Chris@909 27 end
Chris@909 28
Chris@909 29 def test_broken_open_id
Chris@909 30 assert_raises(InvalidOpenId) { normalize_identifier(nil) }
Chris@909 31 end
Chris@909 32 end