Repository navigation
Pin events listing conditional-GET and /events/past query-cost contracts - #2977
Merged
Merged
Conversation
…-cost contracts - Add spec/requests/event_listing_caching_spec.rb: 304 through the full stack for /events/past and /events/upcoming, cache-miss card render, etag rotation when any of the four tables feeding latest_model_updated changes, and stable etag for the empty-database case - Add a /events/past guard scenario to event_card_render_query_cost_spec mixing Workshop, Meeting, and Event cards, asserting the query count stays flat as cards grow
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.
Summary
Follow-up to #2973: pins the contracts that review of that change found untested.
spec/requests/event_listing_caching_spec.rb(new): 304 through the full stack for/events/pastand/events/upcomingwithIf-None-Match, cache-miss card render, ETag rotation when any of the four tables feedinglatest_model_updated(Workshop, Meeting, Event, Member) changes, and the empty-database case. Mirrors the existing pattern inworkshop_show_caching_spec.rb.spec/requests/event_card_render_query_cost_spec.rb: adds a/events/pastguard mixing Workshop, Meeting, and Event (with sponsorship and organisers) cards, asserting per-card query cost stays flat as cards grow.One discovery from pinning the ETag loop: the digest input is truncated to the second (
expand_cache_keyrenders a bareTimeviato_s), so sub-secondupdated_atchanges do not rotate the ETag. The spec touches with explicit times to advance the maximum deterministically.Specs only; no application code changed.
Verification
bundle exec rspec spec/requests/event_listing_caching_spec.rb spec/requests/event_card_render_query_cost_spec.rb spec/controllers/events_controller_spec.rb: 35 examples, 0 failuresrubocop app/green on the source branch;rubocop spec/clean on the two changed files