1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Change the AS::Notification payload to include the mailbox instance

This commit is contained in:
Lewis Buckley 2022-03-10 09:43:34 +00:00
parent 599e73bc00
commit 246c13f8df
No known key found for this signature in database
GPG key ID: 4A9328D3A51196CB
2 changed files with 4 additions and 3 deletions

View file

@ -108,7 +108,7 @@ module ActionMailbox
private
def instrumentation_payload
{
mailbox: self.class.name,
mailbox: self,
inbound_email: inbound_email.instrumentation_payload
}
end

View file

@ -12,13 +12,14 @@ class ActionMailbox::Base::NotificationsTest < ActiveSupport::TestCase
events << ActiveSupport::Notifications::Event.new(*args)
end
RepliesMailbox.receive create_inbound_email_from_fixture("welcome.eml")
mailbox = RepliesMailbox.new(create_inbound_email_from_fixture("welcome.eml"))
mailbox.perform_processing
assert_equal 1, events.length
assert_equal "process.action_mailbox", events[0].name
assert_equal(
{
mailbox: "RepliesMailbox",
mailbox: mailbox,
inbound_email: {
id: 1,
message_id: "0CB459E0-0336-41DA-BC88-E6E28C697DDB@37signals.com",