From: Jean-Philippe Lang Date: Sun, 5 Jul 2015 10:29:59 +0000 (+0000) Subject: Merged r14389 (#20203). X-Git-Tag: 3.1.0~16 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5a76b558aeb2eb97ced3e159d222485935888a31;p=redmine.git Merged r14389 (#20203). git-svn-id: http://svn.redmine.org/redmine/branches/3.1-stable@14400 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/views/settings/_notifications.html.erb b/app/views/settings/_notifications.html.erb index f746f7ced..59a30a9a8 100644 --- a/app/views/settings/_notifications.html.erb +++ b/app/views/settings/_notifications.html.erb @@ -30,7 +30,7 @@
-<%= link_to l(:label_send_test_email), :controller => 'admin', :action => 'test_email' %> +<%= link_to l(:label_send_test_email), { :controller => 'admin', :action => 'test_email' }, :method => :post %>
<%= submit_tag l(:button_save) %> diff --git a/config/routes.rb b/config/routes.rb index 625440c8e..7e8ebeb84 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -324,7 +324,7 @@ Rails.application.routes.draw do match 'admin/projects', :controller => 'admin', :action => 'projects', :via => :get match 'admin/plugins', :controller => 'admin', :action => 'plugins', :via => :get match 'admin/info', :controller => 'admin', :action => 'info', :via => :get - match 'admin/test_email', :controller => 'admin', :action => 'test_email', :via => :get + match 'admin/test_email', :controller => 'admin', :action => 'test_email', :via => :post match 'admin/default_configuration', :controller => 'admin', :action => 'default_configuration', :via => :post resources :auth_sources do diff --git a/test/functional/admin_controller_test.rb b/test/functional/admin_controller_test.rb index bef3e4284..3064d5faa 100644 --- a/test/functional/admin_controller_test.rb +++ b/test/functional/admin_controller_test.rb @@ -87,7 +87,7 @@ class AdminControllerTest < ActionController::TestCase user.pref.save! ActionMailer::Base.deliveries.clear - get :test_email + post :test_email assert_redirected_to '/settings?tab=notifications' mail = ActionMailer::Base.deliveries.last assert_not_nil mail @@ -97,7 +97,7 @@ class AdminControllerTest < ActionController::TestCase def test_test_email_failure_should_display_the_error Mailer.stubs(:test_email).raises(Exception, 'Some error message') - get :test_email + post :test_email assert_redirected_to '/settings?tab=notifications' assert_match /Some error message/, flash[:error] end diff --git a/test/integration/routing/admin_test.rb b/test/integration/routing/admin_test.rb index 0fce80395..16e2c1ca1 100644 --- a/test/integration/routing/admin_test.rb +++ b/test/integration/routing/admin_test.rb @@ -23,7 +23,7 @@ class RoutingAdminTest < Redmine::RoutingTest should_route 'GET /admin/projects' => 'admin#projects' should_route 'GET /admin/plugins' => 'admin#plugins' should_route 'GET /admin/info' => 'admin#info' - should_route 'GET /admin/test_email' => 'admin#test_email' + should_route 'POST /admin/test_email' => 'admin#test_email' should_route 'POST /admin/default_configuration' => 'admin#default_configuration' end end