diff options
author | Louise Crow <louise.crow@gmail.com> | 2014-11-04 09:13:49 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2014-12-12 16:47:14 +0000 |
commit | 3d295b6a69ddd3a3a0cea95a383ee8757f61ed2a (patch) | |
tree | 773c95b3b8c2d7fbfed8d0bbc975428acd7ad3da /app/controllers/admin_request_controller.rb | |
parent | 081c419f665db454b98d8edb60eb67d9d8884c07 (diff) |
Make show_raw_email a RESTful action via GET
Move specs that involve receiving email and then viewing the interface
to be integration specs, which is what they really are.
Diffstat (limited to 'app/controllers/admin_request_controller.rb')
-rw-r--r-- | app/controllers/admin_request_controller.rb | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/app/controllers/admin_request_controller.rb b/app/controllers/admin_request_controller.rb index 6d6bf56e5..4869ea778 100644 --- a/app/controllers/admin_request_controller.rb +++ b/app/controllers/admin_request_controller.rb @@ -175,34 +175,6 @@ class AdminRequestController < AdminController redirect_to admin_request_url(info_request) end - def show_raw_email - @raw_email = RawEmail.find(params[:id]) - # For the holding pen, try to guess where it should be ... - @holding_pen = false - if (@raw_email.incoming_message.info_request == InfoRequest.holding_pen_request && !@raw_email.incoming_message.empty_from_field?) - @holding_pen = true - - # 1. Use domain of email to try and guess which public body it - # is associated with, so we can display that. - email = @raw_email.incoming_message.from_email - domain = PublicBody.extract_domain_from_email(email) - - if domain.nil? - @public_bodies = [] - else - @public_bodies = PublicBody.find(:all, :order => "name", - :conditions => [ "lower(request_email) like lower('%'||?||'%')", domain ]) - end - - # 2. Match the email address in the message without matching the hash - @info_requests = InfoRequest.guess_by_incoming_email(@raw_email.incoming_message) - - # 3. Give a reason why it's in the holding pen - last_event = InfoRequestEvent.find_by_incoming_message_id(@raw_email.incoming_message.id) - @rejected_reason = last_event.params[:rejected_reason] || "unknown reason" - end - end - def download_raw_email @raw_email = RawEmail.find(params[:id]) |