- 'test/unit/lib/redmine/scm/adapters/mercurial_adapter_test.rb'
- 'test/unit/project_test.rb'
-# Cop supports --auto-correct.
-Performance/Count:
- Exclude:
- - 'test/functional/workflows_controller_test.rb'
- - 'test/integration/api_test/issues_test.rb'
- - 'test/unit/issue_test.rb'
-
-# Cop supports --auto-correct.
-Performance/Detect:
- Exclude:
- - 'test/unit/project_copy_test.rb'
-
Performance/FixedSize:
Exclude:
- 'test/integration/api_test/issues_test.rb'
assert_response :success
assert_select 'select[name=?][multiple=multiple]', 'role_id[]' do
- assert_select 'option[selected=selected]', Role.all.select(&:consider_workflow?).count
+ assert_select 'option[selected=selected]', Role.all.count(&:consider_workflow?)
end
assert_select 'select[name=?]', 'tracker_id[]' do
assert_select 'option[selected=selected][value=all]'
json = ActiveSupport::JSON.decode(response.body)
assert_equal 2, json['issue']['children'].size
- assert_equal 1, json['issue']['children'].select {|child| child.key?('children')}.size
+ assert_equal 1, json['issue']['children'].count {|child| child.key?('children')}
end
test "GET /issues/:id.json with no spent time should return floats" do
assert_equal 2, assignable_user_ids.length
assignable_user_ids.each do |user_id|
- assert_equal 1, assignable_user_ids.select {|i| i == user_id}.length,
+ assert_equal 1, assignable_user_ids.count {|i| i == user_id},
"User #{user_id} appears more or less than once"
end
end
# Second issue with a cross project relation
assert_equal 2, copied_second_issue.relations.size, "Relation not copied"
- copied_relation = copied_second_issue.relations.select {|r| r.relation_type == 'duplicates'}.first
+ copied_relation = copied_second_issue.relations.find {|r| r.relation_type == 'duplicates'}
assert_equal "duplicates", copied_relation.relation_type
assert_equal 1, copied_relation.issue_from_id, "Cross project relation not kept"
assert_not_equal source_relation_cross_project.id, copied_relation.id