Add and apply Rails/RedundantActiveRecordAllMethod

This rule was introduced in rubocop-rails 2.21.0.
This commit is contained in:
Javi Martín
2023-10-03 19:45:00 +02:00
parent 522eb6cfa3
commit 0aee568977
17 changed files with 20 additions and 17 deletions

View File

@@ -71,7 +71,7 @@ describe Poll::Shift do
expect do
create(:poll_shift, booth: booth, officer: officer, date: Date.current)
end.to change { Poll::OfficerAssignment.all.count }.by(2)
end.to change { Poll::OfficerAssignment.count }.by(2)
officer_assignments = Poll::OfficerAssignment.all
oa1 = officer_assignments.first
@@ -91,7 +91,7 @@ describe Poll::Shift do
booth_assignment: booth_assignment1,
date: Date.tomorrow)
expect { Poll::Shift.last.destroy }.to change { Poll::OfficerAssignment.all.count }.by(-2)
expect { Poll::Shift.last.destroy }.to change { Poll::OfficerAssignment.count }.by(-2)
end
it "creates final officer_assignments" do