Fix Performance/TimesMap cop (#24789)

This commit is contained in:
Matt Jankowski
2023-05-02 12:07:16 -04:00
committed by GitHub
parent bae694108a
commit 570079f8ce
6 changed files with 15 additions and 24 deletions

View File

@ -902,7 +902,7 @@ RSpec.describe Account, type: :model do
describe 'recent' do
it 'returns a relation of accounts sorted by recent creation' do
matches = 2.times.map { Fabricate(:account) }
matches = Array.new(2) { Fabricate(:account) }
expect(Account.where('id > 0').recent).to match_array(matches)
end
end