aboutsummaryrefslogtreecommitdiffstats
path: root/spec/lib/mail_handler/mail_handler_spec.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2013-08-20 09:51:18 +0100
committerLouise Crow <louise.crow@gmail.com>2013-08-20 09:51:18 +0100
commit3d12cbe6ee7ff49dad9a473efc0792b2a4f4cba6 (patch)
tree1c43d3a004293f442f61b0e64847a4ef16cacd2a /spec/lib/mail_handler/mail_handler_spec.rb
parentc449240a1b1cddebb53e9748b15be43c0f65c463 (diff)
parent4b95ccffc468c256d6ba6248303dd2b78bf5896a (diff)
Merge branch 'release/0.13' into wdtk
Conflicts: locale/he_IL/app.po locale/hr_HR/app.po locale/nb_NO/app.po locale/uk/app.po
Diffstat (limited to 'spec/lib/mail_handler/mail_handler_spec.rb')
-rw-r--r--spec/lib/mail_handler/mail_handler_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/lib/mail_handler/mail_handler_spec.rb b/spec/lib/mail_handler/mail_handler_spec.rb
index d6e7ba5d2..aa351bd94 100644
--- a/spec/lib/mail_handler/mail_handler_spec.rb
+++ b/spec/lib/mail_handler/mail_handler_spec.rb
@@ -9,6 +9,13 @@ end
describe 'when creating a mail object from raw data' do
+ it "should be able to parse a large email without raising an exception", :focus => true do
+ m = Mail.new
+ m.add_file(:filename => "attachment.data", :content => "a" * (8 * 1024 * 1024))
+ raw_email = "From jamis_buck@byu.edu Mon May 2 16:07:05 2005\r\n#{m.to_s}"
+ lambda { Mail::Message.new(raw_email) }.should_not raise_error
+ end
+
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
@@ -60,6 +67,11 @@ describe 'when creating a mail object from raw data' do
body.should match(/ \xe2\x80\x93 /)
end
+ it 'should not error on a subject line with an encoding encoding not recognized by iconv' do
+ mail = get_fixture_mail('unrecognized-encoding-mail.email')
+ lambda{ mail.subject }.should_not raise_error
+ end
+
end
describe 'when asked for the from name' do