From: Tom Hughes Date: Wed, 16 May 2018 09:43:26 +0000 (+0100) Subject: Revert "Remove unused POST method for message replies" X-Git-Tag: live~3558 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/4eb6267f454f3e45eb45eda88ec13d558e1da1c3?ds=sidebyside Revert "Remove unused POST method for message replies" This reverts commit 40cab845fbabb3f0aa8131c16e48cd3d58b6dcb3. --- diff --git a/config/routes.rb b/config/routes.rb index d750d5035..b46f92877 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -266,7 +266,7 @@ OpenStreetMap::Application.routes.draw do match "/message/new/:display_name" => "messages#new", :via => [:get, :post], :as => "new_message" get "/message/read/:message_id" => "messages#show", :as => "message" post "/message/mark/:message_id" => "messages#mark", :as => "mark_message" - get "/message/reply/:message_id" => "messages#reply", :as => "reply_message" + match "/message/reply/:message_id" => "messages#reply", :via => [:get, :post], :as => "reply_message" post "/message/delete/:message_id" => "messages#destroy", :as => "destroy_message" # oauth admin pages (i.e: for setting up new clients, etc...) diff --git a/test/controllers/messages_controller_test.rb b/test/controllers/messages_controller_test.rb index b7bc3bad0..b5ca0dd3a 100644 --- a/test/controllers/messages_controller_test.rb +++ b/test/controllers/messages_controller_test.rb @@ -32,6 +32,10 @@ class MessagesControllerTest < ActionController::TestCase { :path => "/message/reply/1", :method => :get }, { :controller => "messages", :action => "reply", :message_id => "1" } ) + assert_routing( + { :path => "/message/reply/1", :method => :post }, + { :controller => "messages", :action => "reply", :message_id => "1" } + ) assert_routing( { :path => "/message/delete/1", :method => :post }, { :controller => "messages", :action => "destroy", :message_id => "1" }