aboutsummaryrefslogtreecommitdiffstats
path: root/spec/lib/mail_handler/mail_handler_spec.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2015-05-26 10:28:32 +0100
committerLouise Crow <louise.crow@gmail.com>2015-05-26 10:28:32 +0100
commit1e183ce535c81080affb7c185d27c9fe3fb17292 (patch)
treefcaf1e52730b49003738fda2326d307714019217 /spec/lib/mail_handler/mail_handler_spec.rb
parent623317b3a7f49d1b9bffec43e8bc1ea94bf0f885 (diff)
parent4a58e16b189a9e69c160d4e4b9919dd99359ea8e (diff)
Merge branch 'hotfix/0.21.0.32' into rails-3-develop
Diffstat (limited to 'spec/lib/mail_handler/mail_handler_spec.rb')
-rw-r--r--spec/lib/mail_handler/mail_handler_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/lib/mail_handler/mail_handler_spec.rb b/spec/lib/mail_handler/mail_handler_spec.rb
index 7f0070a8a..27a7a3db4 100644
--- a/spec/lib/mail_handler/mail_handler_spec.rb
+++ b/spec/lib/mail_handler/mail_handler_spec.rb
@@ -158,6 +158,16 @@ describe 'when asked for all the addresses a mail has been sent to' do
mail = MailHandler.mail_from_raw_email(mail_data)
MailHandler.get_all_addresses(mail).should == ["request-5555-xxxxxxxx@whatdotheyknow.com"]
end
+
+ it 'should not return invalid addresses' do
+ mail_data = load_file_fixture('autoresponse-header.email')
+ mail_data.gsub!('To: FOI Person <EMAIL_TO>',
+ 'To: <request-5555-xxxxxxxx>')
+ mail = MailHandler.mail_from_raw_email(mail_data)
+ MailHandler.get_all_addresses(mail).should == []
+ end
+
+
end
describe 'when asked for auto_submitted' do