diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/mail_handler/mail_handler_spec.rb | 5 | ||||
-rw-r--r-- | spec/models/incoming_message_spec.rb | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/spec/lib/mail_handler/mail_handler_spec.rb b/spec/lib/mail_handler/mail_handler_spec.rb index efa89b6e0..3ccccc6bc 100644 --- a/spec/lib/mail_handler/mail_handler_spec.rb +++ b/spec/lib/mail_handler/mail_handler_spec.rb @@ -255,19 +255,18 @@ end describe "when parsing HTML mail" do it "should display UTF-8 characters in the plain text version correctly" do html = "<html><b>foo</b> është" - plain_text = MailHandler._get_attachment_text_internal_one_file('text/html', html) + plain_text = MailHandler.get_attachment_text_one_file('text/html', html) plain_text.should match(/është/) end end describe "when getting the attachment text" do - it "should not raise an error if the expansion of a zip file raises an error" do mock_entry = mock('ZipFile entry', :file? => true) mock_entry.stub!(:get_input_stream).and_raise("invalid distance too far back") Zip::ZipFile.stub!(:open).and_return([mock_entry]) - MailHandler._get_attachment_text_internal_one_file('application/zip', "some string") + MailHandler.get_attachment_text_one_file('application/zip', "some string") end end diff --git a/spec/models/incoming_message_spec.rb b/spec/models/incoming_message_spec.rb index 3cfb3d5dd..46dc3a32c 100644 --- a/spec/models/incoming_message_spec.rb +++ b/spec/models/incoming_message_spec.rb @@ -305,12 +305,12 @@ describe IncomingMessage, " when censoring data" do orig_pdf = load_file_fixture('tfl.pdf') pdf = orig_pdf.dup - orig_text = MailHandler._get_attachment_text_internal_one_file('application/pdf', pdf) + orig_text = MailHandler.get_attachment_text_one_file('application/pdf', pdf) orig_text.should match(/foi@tfl.gov.uk/) @im.binary_mask_stuff!(pdf, "application/pdf") - masked_text = MailHandler._get_attachment_text_internal_one_file('application/pdf', pdf) + masked_text = MailHandler.get_attachment_text_one_file('application/pdf', pdf) masked_text.should_not match(/foi@tfl.gov.uk/) masked_text.should match(/xxx@xxx.xxx.xx/) config['USE_GHOSTSCRIPT_COMPRESSION'] = previous |