aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Landauer <matthew@openaustralia.org>2013-03-05 16:13:28 +1100
committerMatthew Landauer <matthew@openaustralia.org>2013-03-05 16:13:28 +1100
commit78f2cb7a5d5ffabaf186e70e6fa02e60cbd724bc (patch)
tree3eb2a8861b2e27a80646dde6eb6b1a296a389de8
parent25aad2807e04e2f0bc5dc339140915d6ca8ef3c7 (diff)
Remove code added previously because on the wrong track
-rw-r--r--app/controllers/request_controller.rb22
-rw-r--r--config/routes.rb1
-rw-r--r--spec/controllers/request_controller_spec.rb62
3 files changed, 0 insertions, 85 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index 8f5eac85c..f2b9150e0 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -487,28 +487,6 @@ class RequestController < ApplicationController
end
end
- def describe_state_requires_admin
- @info_request = InfoRequest.find_by_url_title!(params[:url_title])
-
- # If this is an external request, go to the request page - we don't allow
- # state change from the front end interface.
- if @info_request.is_external?
- redirect_to request_url(@info_request)
- return
- end
-
- unless Ability::can_update_request_state?(authenticated_user, @info_request)
- # If we got here this is always going to be false
- authenticated_as_user?(@info_request.user,
- :web => _("To classify the response to this FOI request"),
- :email => _("Then you can classify the FOI response you have got from ") + @info_request.public_body.name + ".",
- :email_subject => _("Classify an FOI response from ") + @info_request.public_body.name)
- return
- end
-
- @info_request.set_described_state("requires_admin", authenticated_user, params[:message])
- end
-
# Used for links from polymorphic URLs e.g. in Atom feeds - just redirect to
# proper URL for the message the event refers to
def show_request_event
diff --git a/config/routes.rb b/config/routes.rb
index 16f8644dd..0a0736eaa 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -55,7 +55,6 @@ ActionController::Routing::Routes.draw do |map|
request.similar_request '/similar/request/:url_title', :action => 'similar'
request.describe_state '/request/:id/describe', :action => 'describe_state', :conditions => {:method => :post}
- request.describe_state_requires_admin '/request/:url_title/describe/requires_admin', :action => 'describe_state_requires_admin', :conditions => { :method => :post }
request.show_response_no_followup '/request/:id/response', :action => 'show_response'
request.show_response '/request/:id/response/:incoming_message_id', :action => 'show_response'
request.get_attachment_as_html '/request/:id/response/:incoming_message_id/attach/html/:part/*file_name', :action => 'get_attachment_as_html'
diff --git a/spec/controllers/request_controller_spec.rb b/spec/controllers/request_controller_spec.rb
index 4fd674b53..219c04c4a 100644
--- a/spec/controllers/request_controller_spec.rb
+++ b/spec/controllers/request_controller_spec.rb
@@ -1241,68 +1241,6 @@ describe RequestController, "when viewing an individual response for reply/follo
end
-describe RequestController, "describe_state_requires_admin" do
- let (:info_request) { info_requests(:fancy_dog_request) }
-
- before :each do
- InfoRequest.should_receive(:find_by_url_title!).with("info_request").and_return(info_request)
- end
-
- context "logged out" do
- it "should redirect to the login page" do
- post :describe_state_requires_admin, :message => "Something weird happened", :url_title => "info_request"
-
- # Ugh.
- post_redirect = PostRedirect.get_last_post_redirect
- response.should redirect_to(:controller => 'user', :action => 'signin', :token => post_redirect.token)
- end
-
- context "external request" do
- before (:each) { info_request.should_receive(:is_external?).and_return(true) }
-
- it "should not set the state" do
- info_request.should_not_receive(:set_described_state)
- post :describe_state_requires_admin, :message => "Something weird happened", :url_title => "info_request"
- end
-
- it "should redirect to the request page" do
- post :describe_state_requires_admin, :message => "Something weird happened", :url_title => "info_request"
- response.should redirect_to request_url(info_request)
- end
- end
- end
-
- context "logged in" do
- let(:user) { users(:silly_name_user) }
- before (:each) { session[:user_id] = user.id }
-
- context "with permission to change the state" do
- before (:each) do
- Ability.should_receive(:can_update_request_state?).with(user, info_request).and_return(true)
- end
-
- it "should set the state when classified as requires_admin" do
- info_request.should_receive(:set_described_state).with("requires_admin", user, "Something weird happened")
-
- post :describe_state_requires_admin, :message => "Something weird happened", :url_title => "info_request"
- end
- end
-
- context "without permission to change the state" do
- before :each do
- Ability.should_receive(:can_update_request_state?).with(user, info_request).and_return(false)
- end
-
- it "should not allow you to change the state" do
- info_request.should_not_receive(:set_described_state)
-
- post :describe_state_requires_admin, :message => "Something weird happened", :url_title => "info_request"
- response.should render_template('user/wrong_user')
- end
- end
- end
-end
-
describe RequestController, "when classifying an information request" do
describe 'if the request is external' do