Skip to content

DashboardQuery specs: add a query-count guard and host-less workshop coverage #3071

Closed

Description

@mroderick

The spec added in PR #3066 checks host values only, so it cannot detect a query-shape regression on the dashboard path. Two gaps to close in spec/queries/dashboard_query_spec.rb:

Query-count guard. The new example asserts map(&:host)).to all(eq(host)). Workshop#host lazy-loads through workshop_host&.sponsor, so deleting preload(workshop_host: :sponsor) from app/queries/dashboard_query.rb leaves every dashboard spec green while restoring a per-card query on the homepage. The events path already guards this at spec/requests/event_card_render_query_cost_spec.rb:38 ("does not add per-card queries for hosted workshops on /events/upcoming"); the dashboard needs a counterpart that asserts the query count stays flat as the card count grows.

Host-less workshops. Nothing asserts the other half of the #2975 failure mode:

  • a workshop with only non-host sponsors must resolve host to nil, not to one of those sponsors
  • a workshop with no workshop_sponsor rows must render without breakage

Raised from the review of PR #3066. Related: #2982, #2975.

Activity

  1. added a commit that references this issue on Nov 2, 2026
    3fa3586
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions