aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenare Degan <henare.degan@gmail.com>2015-04-27 14:54:07 +1000
committerHenare Degan <henare.degan@gmail.com>2015-04-27 15:21:05 +1000
commitbd234babdab099108283afc7d9a9019f36e067d4 (patch)
treed93e0aa6e825a8326fb29211c96f982e4308180a
parentb0445596de6f4d3c8429ef21f99f6c9eb760dbac (diff)
Don't put HTML entities in overdue alert email subject lines
-rw-r--r--app/mailers/request_mailer.rb2
-rw-r--r--spec/mailers/request_mailer_spec.rb7
2 files changed, 8 insertions, 1 deletions
diff --git a/app/mailers/request_mailer.rb b/app/mailers/request_mailer.rb
index 5461d2aae..b6b16fd25 100644
--- a/app/mailers/request_mailer.rb
+++ b/app/mailers/request_mailer.rb
@@ -105,7 +105,7 @@ class RequestMailer < ApplicationMailer
mail(:from => contact_from_name_and_email,
:to => user.name_and_email,
- :subject => (_("Delayed response to your FOI request - ") + info_request.title).html_safe)
+ :subject => _("Delayed response to your FOI request - ") + info_request.title.html_safe)
end
# Tell the requester that the public body is very late in replying
diff --git a/spec/mailers/request_mailer_spec.rb b/spec/mailers/request_mailer_spec.rb
index 39216e6ab..f8eaad87f 100644
--- a/spec/mailers/request_mailer_spec.rb
+++ b/spec/mailers/request_mailer_spec.rb
@@ -443,3 +443,10 @@ describe RequestMailer, 'requires_admin' do
expect(RequestMailer.requires_admin(@info_request).subject).to eq "FOI response requires admin (error_message) - It's a Test request"
end
end
+
+describe RequestMailer, "overdue_alert" do
+ it 'should not create HTML entities in the subject line' do
+ mail = RequestMailer.overdue_alert(FactoryGirl.create(:info_request, :title => "Here's a request"), FactoryGirl.create(:user))
+ expect(mail.subject).to eq "Delayed response to your FOI request - Here's a request"
+ end
+end