Refactor NPM API request specs for GET dist tags requests

What does this MR do and why?

This is another MR for Refactor and Optimize NPM API request shared ex... (#471721 - closed)

It is a refactoring of slow specs - no bugfixes or behavior changes. The core goal of this MR is to improve the performance of the spec by removing redundant tests done in the large RSpec table, while at the same time maintaining coverage of the cases we care about.

It follows the same approach as Simplify the RSpec table for npm metadata endpo... (!166335 - merged)

It might be easier to review the changes commit by commit, and the changes side by side.

  • Commit 1: Moved helper methods to PackagesManagerApiSpecHelpers
  • Commit 2: Extracted specs for non-existing package into its own context
  • Commit 3: Extracted specs for naming conventions into its own context and removed the package_name_type column from the RSpec table
  • Commit 4: Extracted the auth tests and renamed the handling all conditions shared example to handles authentication

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

NA. Only specs are changed in this MR.

How to set up and validate locally

NA. Only specs are changed in this MR.

Related to #471721 (closed)

Edited by Radamanthus Batnag

Merge request reports

Loading