aboutsummaryrefslogtreecommitdiffstats
path: root/spec/lib/mail_handler
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2012-11-20 16:14:22 +0000
committerLouise Crow <louise.crow@gmail.com>2012-11-20 16:14:22 +0000
commitfcb6cdd6342d0272a8e7f05d20a4b0d87da70de9 (patch)
tree48ea4a5a796c4e95d26e4d4f36170ac09d368637 /spec/lib/mail_handler
parentb0d9551a83c4a101ac808f1c35f66dd138cbc0f1 (diff)
parent24c3ceb2315734ab6e43ae4f75673e251b98a96e (diff)
Merge remote-tracking branch 'origin/feature/isolate-mail-handling' into develop
Diffstat (limited to 'spec/lib/mail_handler')
-rw-r--r--spec/lib/mail_handler/mail_handler_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/lib/mail_handler/mail_handler_spec.rb b/spec/lib/mail_handler/mail_handler_spec.rb
new file mode 100644
index 000000000..a3fba0698
--- /dev/null
+++ b/spec/lib/mail_handler/mail_handler_spec.rb
@@ -0,0 +1,23 @@
+# coding: utf-8
+require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')
+
+describe 'when creating a mail object from raw data' do
+
+ it 'should correctly parse a multipart email with a linebreak in the boundary' do
+ mail = get_fixture_mail('space-boundary.email')
+ mail.parts.size.should == 2
+ mail.multipart?.should == true
+ end
+
+ it 'should parse multiple to addresses with unqoted display names' do
+ mail = get_fixture_mail('multiple-unquoted-display-names.email')
+ mail.to.should == ["request-66666-caa77777@whatdotheyknow.com", "foi@example.com"]
+ end
+
+ it 'should convert an iso8859 email to utf8' do
+ mail = get_fixture_mail('iso8859_2_raw_email.email')
+ mail.subject.should have_text(/gjatë/u)
+ mail.body.is_utf8?.should == true
+ end
+
+end