Commit 0c6f0442 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Enable Performance/TimesMap Rubocop cop

Use Array.new with a block instead of `.times.collect` / `.times.map`.

See #17478
parent 43c35b0f
......@@ -1027,10 +1027,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