diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-01-05 14:42:45 +0000 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-01-05 14:42:45 +0000 |
commit | 19e192b2c6fd2edc49f86868f57e2a5f30c9f1b0 (patch) | |
tree | 3e8efabd1b3a07ea2af5523349ca45ee167f2af7 | |
parent | b06195a428b5cb6c3e95b07c631e2f18febf05f0 (diff) |
Ensure attachments have been parsed before generating cached extracts
-rw-r--r-- | app/models/incoming_message.rb | 1 | ||||
-rw-r--r-- | spec/models/incoming_message_spec.rb | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index a8498b6e8..20989d641 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -619,6 +619,7 @@ class IncomingMessage < ActiveRecord::Base end # Returns body text from main text part of email, converted to UTF-8 def get_main_body_text_internal + parse_raw_email! main_part = get_main_body_text_part return _convert_part_body_to_text(main_part) end diff --git a/spec/models/incoming_message_spec.rb b/spec/models/incoming_message_spec.rb index 08d3d89f7..f514d6546 100644 --- a/spec/models/incoming_message_spec.rb +++ b/spec/models/incoming_message_spec.rb @@ -31,6 +31,13 @@ describe IncomingMessage, " when dealing with incoming mail" do end end + it "should ensure cached body text has been parsed correctly" do + ir = info_requests(:fancy_dog_request) + receive_incoming_mail('quoted-subject-iso8859-1.email', ir.incoming_email) + message = ir.incoming_messages[1] + message.get_main_body_text_unfolded.should_not include("Email has no body") + end + it "should correctly convert HTML even when there's a meta tag asserting that it is iso-8859-1 which would normally confuse elinks" do ir = info_requests(:fancy_dog_request) receive_incoming_mail('quoted-subject-iso8859-1.email', ir.incoming_email) |