aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer
diff options
context:
space:
mode:
Diffstat (limited to 'actionmailer')
-rw-r--r--actionmailer/test/base_test.rb26
1 files changed, 12 insertions, 14 deletions
diff --git a/actionmailer/test/base_test.rb b/actionmailer/test/base_test.rb
index 5fb93b2a59..d0c4f189fd 100644
--- a/actionmailer/test/base_test.rb
+++ b/actionmailer/test/base_test.rb
@@ -897,22 +897,20 @@ class BaseTest < ActiveSupport::TestCase
end
test "notification for process" do
- begin
- events = []
- ActiveSupport::Notifications.subscribe("process.action_mailer") do |*args|
- events << ActiveSupport::Notifications::Event.new(*args)
- end
+ events = []
+ ActiveSupport::Notifications.subscribe("process.action_mailer") do |*args|
+ events << ActiveSupport::Notifications::Event.new(*args)
+ end
- BaseMailer.welcome(body: "Hello there").deliver_now
+ BaseMailer.welcome(body: "Hello there").deliver_now
- assert_equal 1, events.length
- assert_equal "process.action_mailer", events[0].name
- assert_equal "BaseMailer", events[0].payload[:mailer]
- assert_equal :welcome, events[0].payload[:action]
- assert_equal [{ body: "Hello there" }], events[0].payload[:args]
- ensure
- ActiveSupport::Notifications.unsubscribe "process.action_mailer"
- end
+ assert_equal 1, events.length
+ assert_equal "process.action_mailer", events[0].name
+ assert_equal "BaseMailer", events[0].payload[:mailer]
+ assert_equal :welcome, events[0].payload[:action]
+ assert_equal [{ body: "Hello there" }], events[0].payload[:args]
+ ensure
+ ActiveSupport::Notifications.unsubscribe "process.action_mailer"
end
private