smartinez87/exception_notification — pull request #83 by Macint (2012-08-05 21:59:01+00:00)
Title: Tests for smtp settings override

Hello.
These are tests for the smtp_override additions which were comitted by piglop #78 (b67ff5fe9e2acde0ae5435a6c5ba184a4aa9eb96 and 296039104230eb8b8bb8d447290fa8de87dd7b80).

I am quite new to contributing so I am not sure if it is enough. Will these tests suffice?

I have also moved the merging part of piglop's code to now be in the ```compose_email``` method in the notifier.rb file (previously exception_notifier.rb).
```
def compose_email
set_data_variables
subject = compose_subject
name = @env.nil? ? 'background_exception_notification' : 'exception_notification'

mail = mail(:to => @options[:exception_recipients], :from => @options[:sender_address],
:subject => subject, :template_name => name) do |format|
format.text
format.html if html_mail?
end

mail.delivery_method.settings.merge!(@options[:smtp_settings]) if @options[:smtp_settings]

mail
end
```
This way both normal email notifications and background notifications get affected by any overridden smtp options.