aboutsummaryrefslogtreecommitdiffstats
path: root/spec/lib/mail_handler/mail_handler_spec.rb
diff options
context:
space:
mode:
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 e7ad93300..be6da5c4f 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