Patch #20203 ยป 0001-Send-test-email-to-admins-with-POST.patch
| app/views/settings/_notifications.html.erb | ||
|---|---|---|
|
</fieldset>
|
||
|
<div style="float:right;">
|
||
|
<%= 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 %>
|
||
|
</div>
|
||
|
<%= submit_tag l(:button_save) %>
|
||
| config/routes.rb | ||
|---|---|---|
|
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
|
||
| test/functional/admin_controller_test.rb | ||
|---|---|---|
|
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
|
||
| test/integration/routing/admin_test.rb | ||
|---|---|---|
|
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
|
||