Repository navigation
Conversation
mroderick
marked this pull request as ready for review
October 9, 2026 07:37
This branch has not been deployed
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.
This PR was motivated by trying to harvest knowledge from a recent agent session and turn it into something that is actively used, rather than stuffing it into the AGENTS.md file, where it can deteriorate over time.
Adds a spec helper pair that encodes how delivered emails are asserted in this repo, so the knowledge lives in code next to a canary instead of relying on individual specs re-deriving it.
What each piece does
spec/support/helpers/email_helpers.rbdelivered_emails_to(member_or_address)— the test queue adapter is delayed_job withdelay_jobs = falsein test, sodeliver_laterdelivers immediately intoActionMailer::Base.deliveries. This helper is the single place that selects by recipient.email_html(mail)— the invitation mailers send multipart/mixed > multipart/alternative > text/html, sothe root
mail.body.decodedis empty and the html part must be read directly. premailer-rails inlinesCSS on delivery as part of that restructuring.
spec/shared_contexts/email_helpers_spec.rb— a canary in the spirit of the existing 'with forgeryprotection enforced' canary. It delivers a real
WorkshopInvitationMailer.attendingemail and exercisesboth helpers. If the mailer's part structure or the delivery path changes, the canary fails there instead
of silently weakening every email assertion that uses them.
spec/controllers/workshop_invitation_controller_spec.rbis refactored to consume the helpers: its localhtml_bodydefinition and inlinedeliveries.findgo away.Review notes
config.include EmailHelpers(mirrorsconfig.include LoginHelpersin the same file); the method names are email-scoped enough to avoid clashes.spec/shared_contexts/, not next to the helper: rails_helper requiresspec/support/**and RSpec then discovers the file again, running each example twice.behaves_like_sending_workshop_emailscould consumedelivered_emails_totoo, but it asserts counts and recipients today, so it was left untouched.