Commit 5d9ffe65d04c9eced48cc4c29ad576b719123b4e

Authored by Ezra Spier
Committed by Nick Recobra
1 parent 41def7d0
Exists in master and in 1 other branch production

Don't HTML-escape notice message in err notification email text.

@@ -25,4 +25,5 @@ group :test do @@ -25,4 +25,5 @@ group :test do
25 gem 'rspec', '~> 2.5' 25 gem 'rspec', '~> 2.5'
26 gem 'database_cleaner', '~> 0.6.0' 26 gem 'database_cleaner', '~> 0.6.0'
27 gem 'factory_girl_rails' 27 gem 'factory_girl_rails'
  28 + gem 'email_spec'
28 end 29 end
@@ -47,6 +47,8 @@ GEM @@ -47,6 +47,8 @@ GEM
47 bcrypt-ruby (~> 2.1.2) 47 bcrypt-ruby (~> 2.1.2)
48 warden (~> 1.0.2) 48 warden (~> 1.0.2)
49 diff-lcs (1.1.2) 49 diff-lcs (1.1.2)
  50 + email_spec (1.1.1)
  51 + rspec (~> 2.0)
50 erubis (2.6.6) 52 erubis (2.6.6)
51 abstract (>= 1.0.0) 53 abstract (>= 1.0.0)
52 factory_girl (1.3.3) 54 factory_girl (1.3.3)
@@ -139,6 +141,7 @@ DEPENDENCIES @@ -139,6 +141,7 @@ DEPENDENCIES
139 bson_ext (~> 1.2) 141 bson_ext (~> 1.2)
140 database_cleaner (~> 0.6.0) 142 database_cleaner (~> 0.6.0)
141 devise (~> 1.1.8) 143 devise (~> 1.1.8)
  144 + email_spec
142 factory_girl_rails 145 factory_girl_rails
143 haml 146 haml
144 lighthouse-api 147 lighthouse-api
app/views/mailer/err_notification.text.erb
1 -An err has just occurred in <%= @notice.err.environment %>: <%= @notice.err.message %> 1 +An err has just occurred in <%= @notice.err.environment %>: <%= raw(@notice.err.message) %>
2 2
3 This err has occurred <%= pluralize @notice.err.notices_count, 'time' %>. You should really look into it here: 3 This err has occurred <%= pluralize @notice.err.notices_count, 'time' %>. You should really look into it here:
4 4
spec/mailers/mailer_spec.rb 0 → 100644
@@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
  1 +require 'spec_helper'
  2 +
  3 +describe Mailer do
  4 + context "Err Notification" do
  5 + include EmailSpec::Helpers
  6 + include EmailSpec::Matchers
  7 +
  8 + it "should not html-escape the notice's message" do
  9 + @notice = Factory(:notice, :message => "class < ActionController::Base")
  10 + @email = Mailer.err_notification(@notice)
  11 + @email.should have_body_text("class < ActionController::Base")
  12 + end
  13 + end
  14 +end