diff options
-rw-r--r-- | app/controllers/admin_request_controller.rb | 2 | ||||
-rw-r--r-- | app/views/admin_request/show.html.erb | 2 | ||||
-rw-r--r-- | config/routes.rb | 2 | ||||
-rw-r--r-- | spec/controllers/admin_request_controller_spec.rb | 6 |
4 files changed, 6 insertions, 6 deletions
diff --git a/app/controllers/admin_request_controller.rb b/app/controllers/admin_request_controller.rb index 4869ea778..30abc5067 100644 --- a/app/controllers/admin_request_controller.rb +++ b/app/controllers/admin_request_controller.rb @@ -197,7 +197,7 @@ class AdminRequestController < AdminController redirect_to admin_request_url(info_request_event.info_request) end - def hide_request + def hide ActiveRecord::Base.transaction do subject = params[:subject] explanation = params[:explanation] diff --git a/app/views/admin_request/show.html.erb b/app/views/admin_request/show.html.erb index b21dcc05e..65c4a1f4a 100644 --- a/app/views/admin_request/show.html.erb +++ b/app/views/admin_request/show.html.erb @@ -122,7 +122,7 @@ <p class="help-block">(see also option to generate URLs for individual incoming messages below)</p> </div> </div> - <%= form_tag admin_request_hide_path(@info_request), :class => "form form-inline", :id => "hide_request_form", 'data-info-request-id' => @info_request.id.to_s do %> + <%= form_tag hide_admin_request_path(@info_request), :class => "form form-inline", :id => "hide_request_form", 'data-info-request-id' => @info_request.id.to_s do %> <div class="control-group"> <% if @info_request.is_external? %> <label class="control-label">Hide the request:</label> diff --git a/config/routes.rb b/config/routes.rb index 11c23be44..a594f73c0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -219,11 +219,11 @@ Alaveteli::Application.routes.draw do :except => [:new, :create] do post 'move', :on => :member post 'generate_upload_url', :on => :member + post 'hide', :on => :member end end match '/admin/request/download_raw_email/:id' => 'admin_request#download_raw_email', :as => :admin_request_download_raw_email match '/admin/request/mark_event_as_clarification' => 'admin_request#mark_event_as_clarification', :as => :admin_request_clarification - match '/admin/request/hide/:id' => 'admin_request#hide_request', :as => :admin_request_hide #### #### AdminComment controller diff --git a/spec/controllers/admin_request_controller_spec.rb b/spec/controllers/admin_request_controller_spec.rb index 51e4a6dbe..4eb463963 100644 --- a/spec/controllers/admin_request_controller_spec.rb +++ b/spec/controllers/admin_request_controller_spec.rb @@ -91,7 +91,7 @@ describe AdminRequestController, "when administering the holding pen" do it "hides requests and sends a notification email that it has done so" do ir = info_requests(:fancy_dog_request) - post :hide_request, :id => ir.id, :explanation => "Foo", :reason => "vexatious" + post :hide, :id => ir.id, :explanation => "Foo", :reason => "vexatious" ir.reload ir.prominence.should == "requester_only" ir.described_state.should == "vexatious" @@ -104,7 +104,7 @@ describe AdminRequestController, "when administering the holding pen" do it 'expires the file cache for the request' do ir = info_requests(:fancy_dog_request) @controller.should_receive(:expire_for_request).with(ir) - post :hide_request, :id => ir.id, :explanation => "Foo", :reason => "vexatious" + post :hide, :id => ir.id, :explanation => "Foo", :reason => "vexatious" end describe 'when hiding an external request' do @@ -125,7 +125,7 @@ describe AdminRequestController, "when administering the holding pen" do end def make_request(params=@default_params) - post :hide_request, params + post :hide, params end it 'should redirect the the admin page for the request' do |