Commit 5d9ffe65d04c9eced48cc4c29ad576b719123b4e
Committed by
Nick Recobra
1 parent
41def7d0
Exists in
master
and in
1 other branch
Don't HTML-escape notice message in err notification email text.
Showing
4 changed files
with
19 additions
and
1 deletions
Show diff stats
Gemfile
Gemfile.lock
| ... | ... | @@ -47,6 +47,8 @@ GEM |
| 47 | 47 | bcrypt-ruby (~> 2.1.2) |
| 48 | 48 | warden (~> 1.0.2) |
| 49 | 49 | diff-lcs (1.1.2) |
| 50 | + email_spec (1.1.1) | |
| 51 | + rspec (~> 2.0) | |
| 50 | 52 | erubis (2.6.6) |
| 51 | 53 | abstract (>= 1.0.0) |
| 52 | 54 | factory_girl (1.3.3) |
| ... | ... | @@ -139,6 +141,7 @@ DEPENDENCIES |
| 139 | 141 | bson_ext (~> 1.2) |
| 140 | 142 | database_cleaner (~> 0.6.0) |
| 141 | 143 | devise (~> 1.1.8) |
| 144 | + email_spec | |
| 142 | 145 | factory_girl_rails |
| 143 | 146 | haml |
| 144 | 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 | 3 | This err has occurred <%= pluralize @notice.err.notices_count, 'time' %>. You should really look into it here: |
| 4 | 4 | ... | ... |
| ... | ... | @@ -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 | ... | ... |