Skip to content

Assert the waiting-list promotion email on reject - #3001

Merged
mroderick merged 2 commits into
codebar:masterfrom
mroderick:test/waitlist-promotion-email
Oct 9, 2026
Merged

mroderick merged 2 commits into
codebar:masterfrom
mroderick:test/waitlist-promotion-email

Conversation

@mroderick

@mroderick mroderick commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Every waiting-list promotion emails the promoted member via WorkshopPresenter#send_attending_email(invitation, true), and no spec asserted any of it — only the resulting invitation state. This PR pins the email for the reject flow.

One of five small PRs from the same pre-existing-gap audit. Heads are reviewed independently; if a sibling merges first expect a trivial rebase.

Detail

Three assertions, inside the existing "when someone are on waiting list" reject context:

  • The promoted member receives an attending confirmation (matched by recipient).
  • The body uses the promotion copy — only rendered when waiting_list is true; the plain accept copy says something else.
  • Exactly one email goes out in total, so the rejecting member gets no promotion copy.

Repo specifics worth knowing for review. The test queue adapter is delayed_job; delay_jobs = false in
test means deliver_later delivers into ActionMailer::Base.deliveries. The invitation mailer is
multipart/mixed > multipart/alternative > text/html, so the root body.decoded is empty — the specs
read the nested html part via a small html_body helper.

Review notes
  • The copy-match assertion on 'been confirmed' is broad on purpose (view strings change); the flag assertion is the exact promoted copy.
  • Deliberately not added here: the admin-removal call site has no equivalent assertion on master — add it with feat/post-close-rsvp-waitlist, which introduces that call site.

Sibling PRs:

The reject flow emails the promoted member via
WorkshopPresenter#send_attending_email(invitation, true), and no spec
asserted any of it (only the resulting invitation state).

Pin it: the promoted member receives an attending confirmation, the body
uses the promotion copy (only rendered when waiting_list is true; the
plain accept copy differs), and exactly one email goes out.

The admin-removal call site assertion is out of scope here; it can be
added once the feat/post-close-rsvp-waitlist branch merges.
@mroderick
mroderick force-pushed the test/waitlist-promotion-email branch from 7ca6aa0 to 5ac871b Compare October 9, 2026 06:56
@mroderick
mroderick marked this pull request as ready for review October 9, 2026 07:00
@mroderick
mroderick merged commit aebdbe9 into codebar:master Oct 9, 2026
11 checks passed
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