Skip to content

Commit

Permalink
Fix expected URL for link verification (#4152)
Browse files Browse the repository at this point in the history
Its rubygems.org/gems/:name in the plural
  • Loading branch information
segiddins authored Oct 23, 2023
1 parent 99798b5 commit 967349b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
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

0 comments on commit 967349b

Please sign in to comment.