Method: Mail::Message#perform_deliveries
- Defined in:
- lib/mail/message.rb
#perform_deliveries ⇒ Object
If set to false, mail will go through the motions of doing a delivery, but not actually call the delivery method or append the mail object to the Mail.deliveries collection. Useful for testing.
Mail.deliveries.size #=> 0
mail.delivery_method :smtp
mail.perform_deliveries = false
mail.deliver # Mail::SMTP not called here
Mail.deliveries.size #=> 0
If you want to test and query the Mail.deliveries collection to see what mail you sent, you should set perform_deliveries to true and use the :test mail delivery_method:
Mail.deliveries.size #=> 0
mail.delivery_method :test
mail.perform_deliveries = true
mail.deliver
Mail.deliveries.size #=> 1
This setting is ignored by mail (though still available as a flag) if you define a delivery_handler
223 224 225 |
# File 'lib/mail/message.rb', line 223 def perform_deliveries @perform_deliveries end |