aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/admin_raw_email_controller_spec.rb14
-rw-r--r--spec/controllers/admin_request_controller_spec.rb28
2 files changed, 14 insertions, 28 deletions
diff --git a/spec/controllers/admin_raw_email_controller_spec.rb b/spec/controllers/admin_raw_email_controller_spec.rb
new file mode 100644
index 000000000..c1e939ee1
--- /dev/null
+++ b/spec/controllers/admin_raw_email_controller_spec.rb
@@ -0,0 +1,14 @@
+require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
+
+describe AdminRawEmailController do
+
+ describe :show do
+
+ it 'renders the show template' do
+ raw_email = FactoryGirl.create(:incoming_message).raw_email
+ get :show, :id => raw_email.id
+ end
+
+ end
+
+end
diff --git a/spec/controllers/admin_request_controller_spec.rb b/spec/controllers/admin_request_controller_spec.rb
index 0d84c6146..51e4a6dbe 100644
--- a/spec/controllers/admin_request_controller_spec.rb
+++ b/spec/controllers/admin_request_controller_spec.rb
@@ -77,34 +77,6 @@ describe AdminRequestController, "when administering the holding pen" do
load_raw_emails_data
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_public_response.raw_email.id
- response.should contain "Only the authority can reply to this request"
- end
-
- it "guesses a misdirected request" do
- ir = info_requests(:fancy_dog_request)
- ir.handle_rejected_responses = 'holding_pen'
- ir.allow_new_responses_from = 'authority_only'
- ir.save!
- mail_to = "request-#{ir.id}-asdfg@example.com"
- receive_incoming_mail('incoming-request-plain.email', mail_to)
- interesting_email = InfoRequest.holding_pen_request.get_last_public_response.raw_email.id
- # now we add another message to the queue, which we're not interested in
- receive_incoming_mail('incoming-request-plain.email', ir.incoming_email, "")
- InfoRequest.holding_pen_request.incoming_messages.length.should == 2
- get :show_raw_email, :id => interesting_email
- response.should contain "Could not identify the request"
- assigns[:info_requests][0].should == ir
- end
-
-
-
it "shows a suitable default 'your email has been hidden' message" do
ir = info_requests(:fancy_dog_request)
get :show, :id => ir.id