Browse files

add a test for discovering from UTF-8 HTML.

  • Loading branch information...
1 parent fabc53c commit ef53840cd3ff4d207981b75e7646561c1b403bd9 @kou kou committed with chowells79 Jul 5, 2010
Showing with 25 additions and 0 deletions.
  1. +11 −0 test/data/test_discover/openid_utf8.html
  2. +14 −0 test/test_discover.rb
View
11 test/data/test_discover/openid_utf8.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+ <head>
+ <title>Identity Page for Smoker</title>
+ <link rel="openid.server" href="http://www.myopenid.com/server" />
+ <link rel="openid.delegate" href="http://smoker.myopenid.com/" />
+ </head>
+ <body>
+ <p>こんにちは</p>
+ </body>
+</html>
View
14 test/test_discover.rb
@@ -369,6 +369,20 @@ def test_html1And2
}
end
+ def test_html_utf8
+ utf8_html = read_data_file('test_discover/openid_utf8.html', false)
+ utf8_html.force_encoding("UTF-8") if utf8_html.respond_to?(:force_encoding)
+ services = _discover('text/html', utf8_html, 1)
+
+ _checkService(services[0],
+ "http://www.myopenid.com/server",
+ @id_url,
+ 'http://smoker.myopenid.com/',
+ nil,
+ ['1.1'],
+ false)
+ end
+
def test_yadisEmpty
services = _discover('application/xrds+xml',
read_data_file('test_discover/yadis_0entries.xml', false),

0 comments on commit ef53840

Please sign in to comment.