diff options
author | Louise Crow <louise.crow@gmail.com> | 2015-05-22 10:27:52 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2015-05-22 10:27:52 +0100 |
commit | 4a4190d6c595294b0681be110ebe15df5af12e35 (patch) | |
tree | eaac3c897cc8ae7ace34bb20c6b5223329b7a090 /spec/lib/mail_handler/mail_handler_spec.rb | |
parent | 7ef8e696020813445a800cc2bf73ae21fb2a73a4 (diff) |
Handle invalid 'to' addresses.
Diffstat (limited to 'spec/lib/mail_handler/mail_handler_spec.rb')
-rw-r--r-- | spec/lib/mail_handler/mail_handler_spec.rb | 10 |
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 |