mirror of
https://github.com/meineerde/redmine.git
synced 2026-01-31 11:37:14 +00:00
Add test cases for @status=*@, @status=@ and @status=|1|3@ (#40099).
Patch by Jens Krämer (@jkraemer) and Marius BĂLTEANU (@marius.balteanu). git-svn-id: https://svn.redmine.org/redmine/trunk@22623 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
63391766a9
commit
c196f4e2b9
@ -90,6 +90,20 @@ class Redmine::ApiTest::UsersTest < Redmine::ApiTest::Base
|
||||
users = User.where(status: 3)
|
||||
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: { 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)
|
||||
@ -120,6 +134,15 @@ class Redmine::ApiTest::UsersTest < Redmine::ApiTest::Base
|
||||
assert_equal 0, json['users'].size
|
||||
end
|
||||
|
||||
test "GET /users.json with short filters" do
|
||||
get '/users.json', headers: credentials('admin'), params: { status: "1|3" }
|
||||
assert_response :success
|
||||
json = ActiveSupport::JSON.decode(response.body)
|
||||
assert json.key?('users')
|
||||
users = User.where(status: [1,3])
|
||||
assert_equal users.size, json['users'].size
|
||||
end
|
||||
|
||||
test "GET /users/:id.xml should return the user" do
|
||||
Redmine::Configuration.with 'avatar_server_url' => 'https://gravatar.com' do
|
||||
with_settings :gravatar_enabled => '1', :gravatar_default => 'robohash' do
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user