aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/request_controller_spec.rb
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2011-12-21 15:46:06 +0000
committerSeb Bacon <seb.bacon@gmail.com>2011-12-21 15:46:06 +0000
commit757e5cb8a4fc25ddacde849747da2f3e41dd7e73 (patch)
tree5cb1632f1338c1c72d6567fc5822fc10972ff77e /spec/controllers/request_controller_spec.rb
parentef29e5ef9618a4b1e965408df87ed2f4217da6ae (diff)
Ensure we only parse emails when needed by referring to a new last_parsed field on incoming_messages. Currently mails are always parsed just-in-time, but could be parsed as a queue in the future.
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r--spec/controllers/request_controller_spec.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index 74a55062d..4994c2a8f 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -167,7 +167,6 @@ describe RequestController, "when showing one request" do
# change the raw_email associated with the message; this only be reparsed when explicitly asked for
ir.incoming_messages[1].raw_email.data = ir.incoming_messages[1].raw_email.data.sub("Second", "Third")
-
# asking for an attachment by the wrong filename results
# in a 404 for browsing users. This shouldn't cause a
# re-parse...
@@ -183,7 +182,10 @@ describe RequestController, "when showing one request" do
response.should_not have_text(/Third hello/)
# ...but if we explicitly ask for attachments to be extracted, then they should be
- ir.incoming_messages[1].extract_attachments!
+ force = true
+ ir.incoming_messages[1].parse_raw_email!(force)
+ attachment = IncomingMessage.get_attachment_by_url_part_number(ir.incoming_messages[1].get_attachments_for_display, 2)
+ attachment.body.should have_text(/Second hello/)
get :get_attachment_as_html, :incoming_message_id => ir.incoming_messages[1].id, :id => ir.id, :part => 2, :file_name => ['hello.txt.html'], :skip_cache => 1
response.should have_text(/Third hello/)
end