[Refactor] DRY spec/requests/notes_spec.rb#6927
Merged
compwron merged 2 commits intorubyforgood:mainfrom May 5, 2026
Merged
Conversation
compwron
approved these changes
May 5, 2026
2 tasks
compwron
added a commit
that referenced
this pull request
May 5, 2026
Follow-up to the shared-examples extraction. Scope shared_examples to
this describe block (drop the RSpec. prefix that registered them
globally and made the generic names "create"/"edit"/"update"/"delete"
collide-prone), document the implicit let(:user) contract callers must
satisfy, fix the "belongs for volunteer" typo regression, normalize
expect { } to expect do…end for consistency with the new code, hoist
the repeated let(:organization), and standardize context names to use
articles ("as an admin"/"as a supervisor"/"as a volunteer").
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
What github issue is this PR for, if any?
Resolves #6892
What changed, and why?
I created a shared example for each action (i.e.: CREATE, EDIT, UPDATE, DELETE) so it can be reused across different users (i.e.: admin, supervisor).
How is this tested? (please write rspec and jest tests!) 💖💪
I tested this by running
bundle exec rspec ./spec/requests/notes_spec.rborbundle exec rspec ./spec/requests/notes_spec.rb:<line_number>Screenshots please :)
Run your local server and take a screenshot of your work! Try to include the URL of the page as well as the contents of the page.
Feelings gif (optional)
What gif best describes your feeling working on this issue?
