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

Reduce RSpec/ExampleLength in CSP request spec #29104

Merged
merged 2 commits into from Mar 13, 2024

Conversation

mjankowski
Copy link
Contributor

Trying to nudge some of the various RSpec/* cops overriden max values down a number or two if we can.

In this one:

  • Move the random stub to a before
  • Move the expected value to helper method
  • Slightly simplify how we are massaging the strings on both sides

Copy link
Contributor

@ClearlyClaire ClearlyClaire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works, but I don't think the order of clauses is something we should be testing for, I'm afraid this might be too specific and might need changes if something in Rails' internals changes.

Copy link

codecov bot commented Feb 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.01%. Comparing base (86500e3) to head (73584dc).
Report is 241 commits behind head on main.

❗ Current head 73584dc differs from pull request most recent head 91f63c3. Consider uploading reports for the commit 91f63c3 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #29104   +/-   ##
=======================================
  Coverage   85.01%   85.01%           
=======================================
  Files        1059     1059           
  Lines       28277    28293   +16     
  Branches     4538     4535    -3     
=======================================
+ Hits        24040    24054   +14     
- Misses       3074     3075    +1     
- Partials     1163     1164    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mjankowski
Copy link
Contributor Author

Good point, we care about the elements but not the order. Updated to keep the method extraction, but revert back to a looser element comparison instead of the exact string comparison the first version here had.

@renchap renchap added testing Automated lint and test suites ruby Pull requests that update Ruby code labels Feb 16, 2024
@ClearlyClaire ClearlyClaire added this pull request to the merge queue Mar 13, 2024
Merged via the queue into mastodon:main with commit 96013cd Mar 13, 2024
28 of 29 checks passed
@mjankowski mjankowski deleted the example-lenght-req-csp branch March 13, 2024 12:38
lutoma pushed a commit to ohaisocial/mastodon that referenced this pull request Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ruby Pull requests that update Ruby code testing Automated lint and test suites
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants