@@ -30,7 +30,7 | |||||
30 | </fieldset> |
|
30 | </fieldset> | |
31 |
|
31 | |||
32 | <div style="float:right;"> |
|
32 | <div style="float:right;"> | |
33 | <%= link_to l(:label_send_test_email), :controller => 'admin', :action => 'test_email' %> |
|
33 | <%= link_to l(:label_send_test_email), { :controller => 'admin', :action => 'test_email' }, :method => :post %> | |
34 | </div> |
|
34 | </div> | |
35 |
|
35 | |||
36 | <%= submit_tag l(:button_save) %> |
|
36 | <%= submit_tag l(:button_save) %> |
@@ -324,7 +324,7 Rails.application.routes.draw do | |||||
324 | match 'admin/projects', :controller => 'admin', :action => 'projects', :via => :get |
|
324 | match 'admin/projects', :controller => 'admin', :action => 'projects', :via => :get | |
325 | match 'admin/plugins', :controller => 'admin', :action => 'plugins', :via => :get |
|
325 | match 'admin/plugins', :controller => 'admin', :action => 'plugins', :via => :get | |
326 | match 'admin/info', :controller => 'admin', :action => 'info', :via => :get |
|
326 | match 'admin/info', :controller => 'admin', :action => 'info', :via => :get | |
327 |
match 'admin/test_email', :controller => 'admin', :action => 'test_email', :via => : |
|
327 | match 'admin/test_email', :controller => 'admin', :action => 'test_email', :via => :post | |
328 | match 'admin/default_configuration', :controller => 'admin', :action => 'default_configuration', :via => :post |
|
328 | match 'admin/default_configuration', :controller => 'admin', :action => 'default_configuration', :via => :post | |
329 |
|
329 | |||
330 | resources :auth_sources do |
|
330 | resources :auth_sources do |
@@ -87,7 +87,7 class AdminControllerTest < ActionController::TestCase | |||||
87 | user.pref.save! |
|
87 | user.pref.save! | |
88 | ActionMailer::Base.deliveries.clear |
|
88 | ActionMailer::Base.deliveries.clear | |
89 |
|
89 | |||
90 |
|
|
90 | post :test_email | |
91 | assert_redirected_to '/settings?tab=notifications' |
|
91 | assert_redirected_to '/settings?tab=notifications' | |
92 | mail = ActionMailer::Base.deliveries.last |
|
92 | mail = ActionMailer::Base.deliveries.last | |
93 | assert_not_nil mail |
|
93 | assert_not_nil mail | |
@@ -97,7 +97,7 class AdminControllerTest < ActionController::TestCase | |||||
97 |
|
97 | |||
98 | def test_test_email_failure_should_display_the_error |
|
98 | def test_test_email_failure_should_display_the_error | |
99 | Mailer.stubs(:test_email).raises(Exception, 'Some error message') |
|
99 | Mailer.stubs(:test_email).raises(Exception, 'Some error message') | |
100 |
|
|
100 | post :test_email | |
101 | assert_redirected_to '/settings?tab=notifications' |
|
101 | assert_redirected_to '/settings?tab=notifications' | |
102 | assert_match /Some error message/, flash[:error] |
|
102 | assert_match /Some error message/, flash[:error] | |
103 | end |
|
103 | end |
@@ -23,7 +23,7 class RoutingAdminTest < Redmine::RoutingTest | |||||
23 | should_route 'GET /admin/projects' => 'admin#projects' |
|
23 | should_route 'GET /admin/projects' => 'admin#projects' | |
24 | should_route 'GET /admin/plugins' => 'admin#plugins' |
|
24 | should_route 'GET /admin/plugins' => 'admin#plugins' | |
25 | should_route 'GET /admin/info' => 'admin#info' |
|
25 | should_route 'GET /admin/info' => 'admin#info' | |
26 |
should_route ' |
|
26 | should_route 'POST /admin/test_email' => 'admin#test_email' | |
27 | should_route 'POST /admin/default_configuration' => 'admin#default_configuration' |
|
27 | should_route 'POST /admin/default_configuration' => 'admin#default_configuration' | |
28 | end |
|
28 | end | |
29 | end |
|
29 | end |
General Comments 0
You need to be logged in to leave comments.
Login now