BigW Consortium Gitlab

Commit b05981f0 by Robert Speicher

Merge branch 'rubocop/enable-performance-times-map-cop' into 'master'

Enable Performance/TimesMap Rubocop cop Use Array.new with a block instead of `.times.collect` / `.times.map`. See #17478 See merge request !4357
parents e7586cfb 0c6f0442
......@@ -1026,10 +1026,9 @@ Performance/StartWith:
Performance/StringReplacement:
Enabled: true
# TODO: Enable TimesMap Cop.
# Checks for `.times.map` calls.
Performance/TimesMap:
Enabled: false
Enabled: true
##################### Rails ##################################
......
......@@ -15,9 +15,7 @@ describe Issues::BulkUpdateService, services: true do
describe :close_issue do
before do
@issues = 5.times.collect do
create(:issue, project: @project)
end
@issues = create_list(:issue, 5, project: @project)
@params = {
state_event: 'close',
issues_ids: @issues.map(&:id)
......@@ -36,11 +34,8 @@ describe Issues::BulkUpdateService, services: true do
end
describe :reopen_issues do
before do
@issues = 5.times.collect do
create(:closed_issue, project: @project)
end
@issues = create_list(:closed_issue, 5, project: @project)
@params = {
state_event: 'reopen',
issues_ids: @issues.map(&:id)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment