diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-01-24 10:29:17 +0000 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-01-24 10:29:17 +0000 |
commit | a225ecc14774edad034b16ffe62a31e06ff0b98c (patch) | |
tree | c8c950f1f53359e57ba57db7063f798fc754d4df /spec | |
parent | a37e9f21f00af03d271cb40de7d849cb8941bc02 (diff) |
Bug: we are causing a 500 when trying to raise 404 because the arguments to the exception constructor are wrong.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/request_controller_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb index 6a09516fd..cdbb7caf6 100644 --- a/spec/controllers/request_controller_spec.rb +++ b/spec/controllers/request_controller_spec.rb @@ -190,6 +190,15 @@ describe RequestController, "when showing one request" do 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 return 404 when incoming message and request ids don't match " do + ir = info_requests(:fancy_dog_request) + wrong_id = info_requests(:naughty_chicken_request).id + receive_incoming_mail('incoming-request-two-same-name.email', ir.incoming_email) + ir.reload + lambda { + get :get_attachment_as_html, :incoming_message_id => ir.incoming_messages[1].id, :id => wrong_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) |