Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Commit

Permalink
add a test for discovering from UTF-8 HTML.
Browse files Browse the repository at this point in the history
  • Loading branch information
kou authored and chowells79 committed Jul 20, 2010
1 parent fabc53c commit ef53840
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
11 changes: 11 additions & 0 deletions 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>
14 changes: 14 additions & 0 deletions test/test_discover.rb
Expand Up @@ -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),
Expand Down

0 comments on commit ef53840

Please sign in to comment.