Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support/test unicode/punnycode domains #486

Merged
merged 1 commit into from
Aug 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions spec/html-proofer/fixtures/links/punnycode.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<html>

<body>

<p><a href="http://www.xn--mxaaaiil1bdgepgr1bpt0d.gr/">A real link</a></p>

</html>
7 changes: 7 additions & 0 deletions spec/html-proofer/fixtures/links/unicode_domain.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<html>

<body>

<p><a href="http://αναπτυξηεφαρμογων.gr">A real link</a></p>

</html>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions spec/html-proofer/links_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,18 @@
expect(proofer.failed_tests.length).to eq 1
end

it 'allows unicode domains' do
fixture = "#{FIXTURES_DIR}/links/unicode_domain.html"
proofer = run_proofer(fixture, :file)
expect(proofer.failed_tests).to eq []
end

it 'allows punnycode domains' do
fixture = "#{FIXTURES_DIR}/links/punnycode.html"
proofer = run_proofer(fixture, :file)
expect(proofer.failed_tests).to eq []
end

it 'passes for broken *nix links' do
fixture = "#{FIXTURES_DIR}/links/broken_unix_links.html"
proofer = run_proofer(fixture, :file)
Expand Down