aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/test/base_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionmailer/test/base_test.rb')
-rw-r--r--actionmailer/test/base_test.rb22
1 files changed, 10 insertions, 12 deletions
diff --git a/actionmailer/test/base_test.rb b/actionmailer/test/base_test.rb
index 15613d4dce..531bf58ea9 100644
--- a/actionmailer/test/base_test.rb
+++ b/actionmailer/test/base_test.rb
@@ -914,20 +914,18 @@ class BaseTest < ActiveSupport::TestCase
end
test "notification for deliver" do
- begin
- events = []
- ActiveSupport::Notifications.subscribe("deliver.action_mailer") do |*args|
- events << ActiveSupport::Notifications::Event.new(*args)
- end
+ events = []
+ ActiveSupport::Notifications.subscribe("deliver.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 "deliver.action_mailer", events[0].name
- assert_not_nil events[0].payload[:message_id]
- ensure
- ActiveSupport::Notifications.unsubscribe "deliver.action_mailer"
- end
+ assert_equal 1, events.length
+ assert_equal "deliver.action_mailer", events[0].name
+ assert_not_nil events[0].payload[:message_id]
+ ensure
+ ActiveSupport::Notifications.unsubscribe "deliver.action_mailer"
end
private