25 |
25 |
test "GET /users.xml should return users" do
|
26 |
26 |
users = User.active.order('login')
|
27 |
27 |
users.last.update(twofa_scheme: 'totp')
|
28 |
|
get '/users.xml', :headers => credentials('admin')
|
|
28 |
Redmine::Configuration.with 'avatar_server_url' => 'https://gravatar.com' do
|
|
29 |
with_settings :gravatar_enabled => '1' do
|
|
30 |
get '/users.xml', :headers => credentials('admin')
|
|
31 |
end
|
|
32 |
end
|
29 |
33 |
|
30 |
34 |
assert_response :success
|
31 |
35 |
assert_equal 'application/xml', response.media_type
|
... | ... | |
38 |
42 |
|
39 |
43 |
# No one has changed password.
|
40 |
44 |
assert_select user_element, 'passwd_changed_on', :text => ''
|
|
45 |
assert_select user_element, 'avatar_url', :text => %r|\Ahttps://gravatar.com/avatar/\h{32}|
|
41 |
46 |
|
42 |
47 |
if user == users.last
|
43 |
48 |
assert_select user_element, 'twofa_scheme', :text => 'totp'
|
... | ... | |
78 |
83 |
end
|
79 |
84 |
|
80 |
85 |
test "GET /users/:id.xml should return the user" do
|
81 |
|
get '/users/2.xml'
|
|
86 |
Redmine::Configuration.with 'avatar_server_url' => 'https://gravatar.com' do
|
|
87 |
with_settings :gravatar_enabled => '1' do
|
|
88 |
get '/users/2.xml'
|
|
89 |
end
|
|
90 |
end
|
82 |
91 |
|
83 |
92 |
assert_response :success
|
84 |
93 |
assert_select 'user id', :text => '2'
|
85 |
94 |
assert_select 'user updated_on', :text => Time.zone.parse('2006-07-19T20:42:15Z').iso8601
|
86 |
95 |
assert_select 'user passwd_changed_on', :text => ''
|
|
96 |
assert_select 'user avatar_url', :text => %r|\Ahttps://gravatar.com/avatar/\h{32}|
|
87 |
97 |
end
|
88 |
98 |
|
89 |
99 |
test "GET /users/:id.json should return the user" do
|