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

Fix expected URL for link verification #4152

Merged
merged 1 commit into from
Oct 23, 2023
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
2 changes: 1 addition & 1 deletion app/models/rubygem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def yank_versions!(version_id: nil)
end

def linkable_verification_uri
URI.join("https://rubygems.org/gem/", name)
URI.join("https://rubygems.org/gems/", name)
end

private
Expand Down
12 changes: 6 additions & 6 deletions test/jobs/verify_link_job_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ class VerifyLinkJobTest < ActiveJob::TestCase
<html>
<head>
<title>Site with valid linkbacks</title>
<link rel="rubygem" href="https://rubygems.org/gem/mygem">
<link rel="rubygem" href="https://rubygems.org/gems/mygem">
</head>
<body>
<a rel="rubygem" href="https://rubygems.org/gem/mygem/">
<a rel="rubygem" href="https://rubygems.org/gems/mygem/">
</body>
</html>
HTML
Expand All @@ -19,10 +19,10 @@ class VerifyLinkJobTest < ActiveJob::TestCase
<html>
<head>
<title>Site with invalid linkbacks</title>
<link rel="notarubygem" href="https://notrubygems.org/gem/mygem">
<link rel="notarubygem" href="https://notrubygems.org/gems/mygem">
</head>
<body>
<a rel="rubygem" href="https://rubygems.org/gem/notmygem/">notmygem</a>
<a rel="rubygem" href="https://rubygems.org/gems/notmygem/">notmygem</a>
</body>
</html>
HTML
Expand All @@ -33,7 +33,7 @@ class VerifyLinkJobTest < ActiveJob::TestCase
<title>mygem on Github: a gem among gems</title>
</head>
<body>
<a role="link" rel="noopener noreferrer nofollow" href="https://rubygems.org/gem/mygem">my github gem on rubygems.org</a>
<a role="link" rel="noopener noreferrer nofollow" href="https://rubygems.org/gems/mygem">my github gem on rubygems.org</a>
</body>
</html>
HTML
Expand All @@ -44,7 +44,7 @@ class VerifyLinkJobTest < ActiveJob::TestCase
<title>mygem on Github: a gem among gems</title>
</head>
<body>
<a rel="me" href="https://rubygems.org/gem/mygem">my github gem on rubygems.org</a>
<a rel="me" href="https://rubygems.org/gems/mygem">my github gem on rubygems.org</a>
</body>
</html>
HTML
Expand Down