aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/admin_request_controller.rb2
-rw-r--r--app/views/admin_request/edit.html.erb2
-rw-r--r--config/routes.rb1
-rw-r--r--spec/controllers/admin_request_controller_spec.rb4
4 files changed, 4 insertions, 5 deletions
diff --git a/app/controllers/admin_request_controller.rb b/app/controllers/admin_request_controller.rb
index 5ddc32648..b123a3467 100644
--- a/app/controllers/admin_request_controller.rb
+++ b/app/controllers/admin_request_controller.rb
@@ -79,7 +79,7 @@ class AdminRequestController < AdminController
end
end
- def fully_destroy
+ def destroy
@info_request = InfoRequest.find(params[:id])
user = @info_request.user
diff --git a/app/views/admin_request/edit.html.erb b/app/views/admin_request/edit.html.erb
index b97ffab35..68aeb4961 100644
--- a/app/views/admin_request/edit.html.erb
+++ b/app/views/admin_request/edit.html.erb
@@ -51,7 +51,7 @@
<div class="well">
-<%= form_tag admin_request_destroy_path(@info_request) do %>
+<%= form_tag admin_request_path(@info_request), :method => :delete do %>
<p>
<strong>This is permanent and irreversible!</strong> <%= submit_tag 'Destroy request entirely', :class => 'btn btn-danger' %>
<br>Use it mainly if someone posts private information, e.g. made a Data Protection request. It
diff --git a/config/routes.rb b/config/routes.rb
index aeeab785d..a16f304be 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -221,7 +221,6 @@ Alaveteli::Application.routes.draw do
end
match '/admin/request/edit/:id' => 'admin_request#edit', :as => :admin_request_edit
match '/admin/request/update/:id' => 'admin_request#update', :as => :admin_request_update
- match '/admin/request/destroy/:id' => 'admin_request#fully_destroy', :as => :admin_request_destroy
match '/admin/request/edit_comment/:id' => 'admin_request#edit_comment', :as => :admin_request_edit_comment
match '/admin/request/update_comment/:id' => 'admin_request#update_comment', :as => :admin_request_update_comment
match '/admin/request/move_request' => 'admin_request#move_request', :as => :admin_request_move_request
diff --git a/spec/controllers/admin_request_controller_spec.rb b/spec/controllers/admin_request_controller_spec.rb
index 7c5253f49..0d84c6146 100644
--- a/spec/controllers/admin_request_controller_spec.rb
+++ b/spec/controllers/admin_request_controller_spec.rb
@@ -57,12 +57,12 @@ describe AdminRequestController, "when administering requests" do
it 'expires the file cache for that request' do
info_request = info_requests(:badger_request)
@controller.should_receive(:expire_for_request).with(info_request)
- get :fully_destroy, { :id => info_request }
+ get :destroy, { :id => info_request }
end
it 'uses a different flash message to avoid trying to fetch a non existent user record' do
info_request = info_requests(:external_request)
- post :fully_destroy, { :id => info_request.id }
+ post :destroy, { :id => info_request.id }
request.flash[:notice].should include('external')
end