# API backwards compatibility: handle legacy filter parameters
unless request.format.html?
- if params.include?(:status) && params[:status].blank?
- ActiveSupport::Deprecation.warn "Getting all users from API using an empty status param (status=) is deprecated and it will be removed in Redmine 6.0. Please use \"status=*\"."
- @query.add_filter 'status', '*'
- end
if name = params[:name].presence
@query.add_filter 'name', '~', [name]
end
users = User.logged
assert_equal users.size, json['users'].size
- get '/users.json', headers: credentials('admin'), params: { status: ''}
- assert_response :success
- json = ActiveSupport::JSON.decode(response.body)
- assert json.key?('users')
- users = User.logged
- assert_equal users.size, json['users'].size
-
get '/users.json', headers: credentials('admin'), params: { name: 'jsmith' }
assert_response :success
json = ActiveSupport::JSON.decode(response.body)