-
-
Notifications
You must be signed in to change notification settings - Fork 513
chore: remove superfluous test code #6506
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
base: main
Are you sure you want to change the base?
Conversation
compwron
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm if CI goes green
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes redundant allow(view).to receive(:current_user).and_return(user) test setup code from multiple view specification files. The removed code was superfluous as the test suite continues to pass without it, indicating that other test setup mechanisms (like sign_in user or enable_pundit) are sufficient for providing the necessary authentication context.
- Removes duplicate
current_userstubbing across 10 view spec files - Cleans up test setup while maintaining existing functionality
- Simplifies test code by eliminating unnecessary mock configurations
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| spec/views/volunteers/index.html.erb_spec.rb | Removed redundant current_user stubbing |
| spec/views/reimbursements/index.html.erb_spec.rb | Removed redundant current_user stubbing |
| spec/views/placements/edit.html.erb_spec.rb | Removed redundant current_user stubbing |
| spec/views/mileage_rates/index.html.erb_spec.rb | Removed redundant current_user stubbing |
| spec/views/court_dates/show.html.erb_spec.rb | Removed redundant current_user and current_organization stubbing |
| spec/views/court_dates/edit.html.erb_spec.rb | Removed redundant current_user stubbing |
| spec/views/casa_cases/new.html.erb_spec.rb | Removed redundant current_user and current_organization stubbing |
| spec/views/casa_admins/admins_table.html.erb_spec.rb | Removed redundant current_user stubbing |
| spec/views/banners/new.html.erb_spec.rb | Removed redundant current_user stubbing from multiple test cases |
| spec/views/all_casa_admins/casa_orgs/show.html.erb_spec.rb | Removed redundant current_user stubbing |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
The base branch was changed.
|
This PR has been open for a long time without any pushes or comments! What's up? |
What changed, and why?
In the process of working on #6491, I noticed that there was extra view spec setup code that I had copy-pasted into my new view specs.
Turned out to be superfluous, so I tried take the same code out everywhere else it appeared. These are the tests where that could be done safely!
How is this tested?
Deleted code, Rspec suite still passes: ✅
Screenshots please :)