Class: NormalizeTest

Inherits:
Test::Unit::TestCase
  • Object
show all
Includes:
OpenIdAuthentication
Defined in:
lib/plugins/open_id_authentication/test/normalize_test.rb

Constant Summary collapse

NORMALIZATIONS =
{
  "openid.aol.com/nextangler"             => "http://openid.aol.com/nextangler",
  "http://openid.aol.com/nextangler"      => "http://openid.aol.com/nextangler",
  "https://openid.aol.com/nextangler"     => "https://openid.aol.com/nextangler",
  "HTTP://OPENID.AOL.COM/NEXTANGLER"      => "http://openid.aol.com/NEXTANGLER",
  "HTTPS://OPENID.AOL.COM/NEXTANGLER"     => "https://openid.aol.com/NEXTANGLER",
  "loudthinking.com"                      => "http://loudthinking.com/",
  "http://loudthinking.com"               => "http://loudthinking.com/",
  "http://loudthinking.com:80"            => "http://loudthinking.com/",
  "https://loudthinking.com:443"          => "https://loudthinking.com/",
  "http://loudthinking.com:8080"          => "http://loudthinking.com:8080/",
  "techno-weenie.net"                     => "http://techno-weenie.net/",
  "http://techno-weenie.net"              => "http://techno-weenie.net/",
  "http://techno-weenie.net  "            => "http://techno-weenie.net/",
  "=name"                                 => "=name"
}

Instance Method Summary collapse

Methods included from OpenIdAuthentication

new, normalize_identifier, store, store=

Instance Method Details

#test_broken_open_idObject


29
30
31
# File 'lib/plugins/open_id_authentication/test/normalize_test.rb', line 29

def test_broken_open_id
  assert_raises(InvalidOpenId) { normalize_identifier(nil) }
end

#test_normalizationsObject


23
24
25
26
27
# File 'lib/plugins/open_id_authentication/test/normalize_test.rb', line 23

def test_normalizations
  NORMALIZATIONS.each do |from, to|
    assert_equal to, normalize_identifier(from)
  end
end