Skip to content

Commit

Permalink
Merge pull request #44655 from lewispb/action-mailbox-instrumentation
Browse files Browse the repository at this point in the history
Change the Action Mailbox AS::Notification payload to include the mailbox instance
  • Loading branch information
rafaelfranca committed Mar 14, 2022
2 parents 98b2e8a + 246c13f commit b9e8642
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion actionmailbox/lib/action_mailbox/base.rb
Expand Up @@ -108,7 +108,7 @@ def bounce_with(message)
private
def instrumentation_payload
{
mailbox: self.class.name,
mailbox: self,
inbound_email: inbound_email.instrumentation_payload
}
end
Expand Down
5 changes: 3 additions & 2 deletions actionmailbox/test/unit/mailbox/notifications_test.rb
Expand Up @@ -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",
Expand Down

0 comments on commit b9e8642

Please sign in to comment.