diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-01-18 11:21:27 +0000 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-01-18 11:21:27 +0000 |
commit | c1cfd0944500982a62187ec0cf22f008b1f1e723 (patch) | |
tree | a47d72770ea469e783b7395bbb81b61a36b28ab5 /spec/controllers/request_controller_spec.rb | |
parent | d650cdddaec072d6249992ae6a254070fdda6864 (diff) |
Return a 404 for broken attachment urls. Fixes #351.
Diffstat (limited to 'spec/controllers/request_controller_spec.rb')
-rw-r--r-- | spec/controllers/request_controller_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index b8056d782..97688b3c0 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -171,6 +171,16 @@ describe RequestController, "when showing one request" do response.should have_text(/Second hello/) end + it "should return 404 for ugly URLs contain a request id that isn't an integer " do + ir = info_requests(:fancy_dog_request) + receive_incoming_mail('incoming-request-two-same-name.email', ir.incoming_email) + ir.reload + ugly_id = "55195" + lambda { + get :get_attachment_as_html, :incoming_message_id => ir.incoming_messages[1].id, :id => ugly_id, :part => 2, :file_name => ['hello.txt.html'], :skip_cache => 1 + }.should raise_error(ActiveRecord::RecordNotFound) + end + it "should generate valid HTML verson of PDF attachments " do ir = info_requests(:fancy_dog_request) receive_incoming_mail('incoming-request-pdf-attachment.email', ir.incoming_email) |