aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/admin_request_controller_spec.rb
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2011-08-03 15:11:28 +0100
committerSeb Bacon <seb.bacon@gmail.com>2011-08-03 15:11:49 +0100
commit1708f4a4c3f27e5bbbbb5818623dc1eb6688d2f0 (patch)
treeb98cc9680aef34e4d67b4af9a205586cc1a50b2a /spec/controllers/admin_request_controller_spec.rb
parent4f501309ade230f65f4ba45e1d0161e89587d755 (diff)
Log the reason why an incoming mail is routed to the holding pen, and display it to administrators. Closes #107.
Diffstat (limited to 'spec/controllers/admin_request_controller_spec.rb')
-rw-r--r--spec/controllers/admin_request_controller_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/controllers/admin_request_controller_spec.rb b/spec/controllers/admin_request_controller_spec.rb
index d82e4a49c..0b12fa97a 100644
--- a/spec/controllers/admin_request_controller_spec.rb
+++ b/spec/controllers/admin_request_controller_spec.rb
@@ -39,3 +39,22 @@ describe AdminRequestController, "when administering requests" do
end
+describe AdminRequestController, "when administering the holding pen" do
+ integrate_views
+ fixtures :info_requests, :incoming_messages, :raw_emails, :users, :public_bodies, :public_body_translations
+ before(:each) do
+ basic_auth_login @request
+ load_raw_emails_data(raw_emails)
+ end
+
+ it "shows a rejection reason for an incoming message from an invalid address" do
+ ir = info_requests(:fancy_dog_request)
+ ir.allow_new_responses_from = 'authority_only'
+ ir.handle_rejected_responses = 'holding_pen'
+ ir.save!
+ receive_incoming_mail('incoming-request-plain.email', ir.incoming_email, "frob@nowhere.com")
+ get :show_raw_email, :id => InfoRequest.holding_pen_request.get_last_response.raw_email.id
+ response.should have_text(/Only the authority can reply to this request/)
+ end
+
+end