summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2022-05-28 09:55:51 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2022-05-28 09:55:51 +0000
commit0418a92c4837de0169a0173ef202d28494a86b23 (patch)
tree67587043e01ba1eaa0d2dea941359b7e61aba587 /test
parent76547303572b7e009a81c19c08cf72190616b57e (diff)
downloadredmine-0418a92c4837de0169a0173ef202d28494a86b23.tar.gz
redmine-0418a92c4837de0169a0173ef202d28494a86b23.zip
Merged r21606 to 5.0-stable (#37157).
git-svn-id: https://svn.redmine.org/redmine/branches/5.0-stable@21615 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/integration/api_test/users_test.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/integration/api_test/users_test.rb b/test/integration/api_test/users_test.rb
index 26473356a..8444500d9 100644
--- a/test/integration/api_test/users_test.rb
+++ b/test/integration/api_test/users_test.rb
@@ -96,6 +96,24 @@ class Redmine::ApiTest::UsersTest < Redmine::ApiTest::Base
assert_select 'user avatar_url', :text => %r|\Ahttps://gravatar.com/avatar/\h{32}\?default=robohash|
end
+ test "GET /users/:id.xml should not return avatar_url when not set email address" do
+ user = User.find(2)
+ user.email_addresses.delete_all
+ assert_equal 'jsmith', user.login
+ assert_nil user.mail
+
+ Redmine::Configuration.with 'avatar_server_url' => 'https://gravatar.com' do
+ with_settings :gravatar_enabled => '1', :gravatar_default => 'robohash' do
+ get '/users/2.xml'
+ end
+ end
+
+ assert_response :success
+ assert_select 'user id', :text => '2'
+ assert_select 'user login', :text => 'jsmith'
+ assert_select 'user avatar_url', :count => 0
+ end
+
test "GET /users/:id.json should return the user" do
get '/users/2.json'