diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2011-08-17 10:52:15 +0100 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2011-08-17 11:52:47 +0100 |
commit | 7c7d7187b682f926e39231bcc748b0694d594445 (patch) | |
tree | 4c5e0614e28e152b25d9f95e96146cc606491dc1 /spec/controllers/request_controller_spec.rb | |
parent | 907349307449d473c9fda62154f811e6260af454 (diff) |
Add test for generation of HTML versions of attachments. As a side-effect, make some of the HTML more valid. Prerequisite for addressing issue #108.
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r-- | spec/controllers/request_controller_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index a9315ddb2..f69cf414c 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -125,6 +125,14 @@ describe RequestController, "when showing one request" do response.should have_text(/First hello/) end + it "should generate valid HTML verson of plain text attachments " do + ir = info_requests(:fancy_dog_request) + receive_incoming_mail('incoming-request-two-same-name.email', ir.incoming_email) + 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.content_type.should == "text/html" + response.should have_text(/Second hello/) + end + it "should treat attachments with unknown extensions as binary" do ir = info_requests(:fancy_dog_request) receive_incoming_mail('incoming-request-attachment-unknown-extension.email', ir.incoming_email) |