summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2020-12-03 15:14:35 +0000
committerGo MAEDA <maeda@farend.jp>2020-12-03 15:14:35 +0000
commitc8227930f9321251879e2ec0cde36c53b7777f46 (patch)
treecd1c43a62921202c23f1c58d164c00f3aeb26369 /test
parent7c292dd23c6067bc5bf7227a6cc6303e43b0341b (diff)
downloadredmine-c8227930f9321251879e2ec0cde36c53b7777f46.tar.gz
redmine-c8227930f9321251879e2ec0cde36c53b7777f46.zip
TypeError when attempting to update a user with a blank email address (#33355).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@20562 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/functional/users_controller_test.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb
index dfc6be848..459762c50 100644
--- a/test/functional/users_controller_test.rb
+++ b/test/functional/users_controller_test.rb
@@ -819,6 +819,19 @@ class UsersControllerTest < Redmine::ControllerTest
assert_response 404
end
+ def test_update_with_blank_email_should_not_raise_exception
+ assert_no_difference 'User.count' do
+ with_settings :gravatar_enabled => '1' do
+ put :update, :params => {
+ :id => 2,
+ :user => {:mail => ''}
+ }
+ end
+ end
+ assert_response :success
+ assert_select_error /Email cannot be blank/
+ end
+
def test_destroy
assert_difference 'User.count', -1 do
delete :destroy, :params => {:id => 2}