From 36cc6ce0d49f5bf3c5808307afeea5985dc6d8dc Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Fri, 15 Feb 2013 12:29:36 +0000 Subject: Fix for #808. SafeBuffer and ActionMailer::Quoting.quoted_printable don't play well together, so convert all subject lines to strings before passing them off to actionmailer. --- spec/models/request_mailer_spec.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'spec/models') diff --git a/spec/models/request_mailer_spec.rb b/spec/models/request_mailer_spec.rb index 5edc8edb6..20d401a63 100644 --- a/spec/models/request_mailer_spec.rb +++ b/spec/models/request_mailer_spec.rb @@ -327,6 +327,27 @@ describe RequestMailer, 'when sending mail when someone has updated an old uncla end + +describe RequestMailer, 'when sending a new response email' do + + before do + @user = mock_model(User, :name_and_email => 'test name and email') + @public_body = mock_model(PublicBody, :name => 'Test public body') + @info_request = mock_model(InfoRequest, :user => @user, + :law_used_full => 'Freedom of Information', + :title => 'Here is a character that needs quoting …', + :public_body => @public_body, + :display_status => 'Refused.', + :url_title => 'test_request') + @incoming_message = mock_model(IncomingMessage, :info_request => @info_request) + end + + it 'should not error when sending mails requests with characters requiring quoting in the subject' do + @mail = RequestMailer.create_new_response(@info_request, @incoming_message) + end + +end + describe RequestMailer, 'requires_admin' do before(:each) do user = mock_model(User, :name_and_email => 'Bruce Jones', -- cgit v1.2.3