Skip to content

Add RSpec matchers for Rails 8.1+ EventReporter#2877

Open
keshavbiswa wants to merge 5 commits intorspec:mainfrom
keshavbiswa:kb/events-reporting-final
Open

Add RSpec matchers for Rails 8.1+ EventReporter#2877
keshavbiswa wants to merge 5 commits intorspec:mainfrom
keshavbiswa:kb/events-reporting-final

Conversation

@keshavbiswa
Copy link

@keshavbiswa keshavbiswa commented Dec 20, 2025

Add RSpec matchers for Rails 8.1+ EventReporter

Introduces matchers for testing ActiveSupport::EventReporter:

  • have_reported_event: Assert an event was reported
  • with_payload: Match event payload
  • with_contexts: Match event contexts
  • with_tags: Match event tags
  • have_reported_no_event: Assert no matching events
  • have_reported_events: Assert multiple events
  • with_debug_event_reporting: Helper to enable debug mode in tests

Related issue: #2876

Add RSpec matchers for Rails 8.1+ EventReporter

Introduces matchers for testing ActiveSupport::EventReporter:
- have_reported_event: Assert an event was reported
- with_payload: Match event payload
- with_tags: Match event tags
- have_reported_no_event: Assert no matching events
- have_reported_events: Assert multiple events
- with_debug_event_reporting: Helper to enable debug mode in tests
@keshavbiswa keshavbiswa changed the title Add RSpec matchers for Rails 8.1+ EventReporter [WIP] Add RSpec matchers for Rails 8.1+ EventReporter Dec 20, 2025
@keshavbiswa keshavbiswa changed the title [WIP] Add RSpec matchers for Rails 8.1+ EventReporter Add RSpec matchers for Rails 8.1+ EventReporter Dec 21, 2025
@keshavbiswa keshavbiswa requested a review from moofkit February 4, 2026 15:31
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.

2 participants