Commit 391a1271e869a0d4a95316e5478ac40d54f0dc1a

Authored by Philip Hallstrom
1 parent e260daf4
Exists in master and in 1 other branch production

Modify err_notification email subject to include the Rails environment. Add tes…

…t for this and add one to ensure app name is there as well
app/mailers/mailer.rb
@@ -7,7 +7,7 @@ class Mailer < ActionMailer::Base @@ -7,7 +7,7 @@ class Mailer < ActionMailer::Base
7 7
8 mail({ 8 mail({
9 :to => @app.watchers.map(&:address), 9 :to => @app.watchers.map(&:address),
10 - :subject => "[#{@app.name}] #{@notice.err.message}" 10 + :subject => "[#{@app.name}][#{@notice.err.environment}] #{@notice.err.message}"
11 }) 11 })
12 end 12 end
13 13
@@ -21,4 +21,4 @@ class Mailer < ActionMailer::Base @@ -21,4 +21,4 @@ class Mailer < ActionMailer::Base
21 }) 21 })
22 end 22 end
23 23
24 -end  
25 \ No newline at end of file 24 \ No newline at end of file
  25 +end
spec/controllers/notices_controller_spec.rb
@@ -24,6 +24,8 @@ describe NoticesController do @@ -24,6 +24,8 @@ describe NoticesController do
24 email = ActionMailer::Base.deliveries.last 24 email = ActionMailer::Base.deliveries.last
25 email.to.should include(@app.watchers.first.email) 25 email.to.should include(@app.watchers.first.email)
26 email.subject.should include(@notice.err.message) 26 email.subject.should include(@notice.err.message)
  27 + email.subject.should include("[#{@app.name}]")
  28 + email.subject.should include("[#{@notice.err.environment}]")
27 end 29 end
28 end 30 end
29 31