Repository navigation
Add jscpd duplication check and merge duplicated signup spec - #1454
Open
diego-suarez wants to merge 1 commit into
Open
diego-suarez wants to merge 1 commit into
diego-suarez wants to merge 1 commit into
Conversation
spec/requests/api/v1/users/create_spec.rb and spec/requests/api/v1/registrations/create_spec.rb both exercised POST /api/v1/users (user_registration_path). Merge them into the registrations spec, which matches the controller, and add jscpd to the Linters CI job so new copy/paste is caught. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Board:
Description:
jscpd .over the repo found 17 clones (7.2% duplicated lines). Most are expected:doc/openapi.yamlis generated by rspec-openapi,public/*.htmlare Rails' self-contained error pages, and the GitHub Actions setup steps have to repeat per job.spec/requests/api/v1/users/create_spec.rbandspec/requests/api/v1/registrations/create_spec.rbboth tested the same endpoint (post user_registration_path→POST /api/v1/users). The registrations spec was also mislabelledPOST api/v1/users/sign_up, a route that doesn't exist.spec/requests/api/v1/registrations/create_spec.rb, which matchesAPI::V1::RegistrationsControllerlike thesessions/andpasswords/specs do. The more completeusers/version is the base, plus the two assertions that only the registrations spec had (valid client/access token, password-mismatch error message)..jscpd.jsonignores generated/static files and fails above 1% duplicated lines. Duplication after this PR is 0.65%.Notes:
describetext.knapsack_rspec_report.jsontiming entry renamed to the new spec path. It's regenerated by the Update Knapsack Report workflow anyway..jscpd.jsonif it turns out to be noisy.Tasks:
users/create_spec.rbintoregistrations/create_spec.rband delete the duplicate.jscpd.json(threshold 1%, ignoredoc/openapi.yaml,public/*.html,knapsack_rspec_report.json)Check for duplicated codestep to the Linters job (npx --yes jscpd@5.4.1 .)npx jscpd .inCLAUDE.mdRisk:
Preview:
🤖 Generated with Claude Code