Skip to content

DRY up duplicated count_queries test helper - #11884

Merged
nbudin merged 1 commit into
investigate-unrelated-n-plus-onesfrom
dry-up-count-queries-test-helper
Aug 6, 2026
Merged

DRY up duplicated count_queries test helper#11884
nbudin merged 1 commit into
investigate-unrelated-n-plus-onesfrom
dry-up-count-queries-test-helper

Conversation

@nbudin

@nbudin nbudin commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

The N+1 query regression tests added across the last few PRs (#11880, #11882, #11883) each defined their own private count_queries(pattern) { ... } helper -- byte-identical in all six files. Moved it onto ActiveSupport::TestCase in test_helper.rb, next to the existing execute_graphql_query helper that's set up the same way, so every test file gets it for free.

test/services/event_signup_service_test.rb's other private helpers (bucket_id_for, create_other_signup) are untouched.

Test plan

  • Ran all six affected test files (97 tests) -- unchanged behavior, just less duplication
  • rubocop / stree clean

🤖 Generated with Claude Code

Six test files had grown byte-identical copies of this N+1 query-count
helper. Defined it once on ActiveSupport::TestCase in test_helper.rb
instead, matching the existing execute_graphql_query helper there.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@nbudin
nbudin merged commit ac68f4e into main Aug 6, 2026
21 of 26 checks passed
@nbudin
nbudin deleted the dry-up-count-queries-test-helper branch August 6, 2026 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant