Fix RuboCop offenses due to r22343: Style/RedundantRegexpEscape, Layout/EmptyLinesAroundMethodBody, and Style/HashSyntax (#39181).

git-svn-id: https://svn.redmine.org/redmine/trunk@22346 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2023-10-16 14:17:35 +00:00
parent 28a45b7144
commit 03280712d3
2 changed files with 6 additions and 7 deletions

View File

@@ -83,21 +83,21 @@ class Redmine::ApiTest::UsersTest < Redmine::ApiTest::Base
end
test "GET /users.json with legacy filter params" do
get '/users.json', :headers => credentials('admin'), params: { status: 3 }
get '/users.json', headers: credentials('admin'), params: { status: 3 }
assert_response :success
json = ActiveSupport::JSON.decode(response.body)
assert json.key?('users')
users = User.where(status: 3)
assert_equal users.size, json['users'].size
get '/users.json', :headers => credentials('admin'), params: { name: 'jsmith' }
get '/users.json', headers: credentials('admin'), params: { name: 'jsmith' }
assert_response :success
json = ActiveSupport::JSON.decode(response.body)
assert json.key?('users')
assert_equal 1, json['users'].size
assert_equal 2, json['users'][0]['id']
get '/users.json', :headers => credentials('admin'), params: { group_id: '10' }
get '/users.json', headers: credentials('admin'), params: { group_id: '10' }
assert_response :success
json = ActiveSupport::JSON.decode(response.body)
assert json.key?('users')
@@ -107,13 +107,13 @@ class Redmine::ApiTest::UsersTest < Redmine::ApiTest::Base
# there should be an implicit filter for status = 1
User.where(id: [2, 8]).update_all status: 3
get '/users.json', :headers => credentials('admin'), params: { name: 'jsmith' }
get '/users.json', headers: credentials('admin'), params: { name: 'jsmith' }
assert_response :success
json = ActiveSupport::JSON.decode(response.body)
assert json.key?('users')
assert_equal 0, json['users'].size
get '/users.json', :headers => credentials('admin'), params: { group_id: '10' }
get '/users.json', headers: credentials('admin'), params: { group_id: '10' }
assert_response :success
json = ActiveSupport::JSON.decode(response.body)
assert json.key?('users')