Skip to content

Conversation

@abachman
Copy link
Member

@abachman abachman commented Sep 13, 2025

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 :)

image

@github-actions github-actions bot added ruby Pull requests that update Ruby code Tests! 🎉💖👏 labels Sep 13, 2025
gvt
gvt previously approved these changes Sep 13, 2025
compwron
compwron previously approved these changes Sep 26, 2025
Copy link
Collaborator

@compwron compwron left a 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

@compwron compwron requested a review from Copilot October 7, 2025 17:09
Copy link
Contributor

Copilot AI left a 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_user stubbing 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.

Base automatically changed from rfg-event-2025 to main October 8, 2025 22:57
@compwron compwron dismissed stale reviews from gvt and themself October 8, 2025 22:57

The base branch was changed.

@github-actions
Copy link

This PR has been open for a long time without any pushes or comments! What's up?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-pr-activity ruby Pull requests that update Ruby code Tests! 🎉💖👏

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants