From d26251628dbec6c25bc8028cf618d4543b6c9a35 Mon Sep 17 00:00:00 2001 From: Bianca Nenciu Date: Tue, 24 Dec 2024 11:06:34 +0200 Subject: [PATCH] Apply suggestions --- spec/jobs/grant_badge_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/jobs/grant_badge_spec.rb b/spec/jobs/grant_badge_spec.rb index 9f9a0558b86..1f9bb2e48a0 100644 --- a/spec/jobs/grant_badge_spec.rb +++ b/spec/jobs/grant_badge_spec.rb @@ -4,11 +4,11 @@ RSpec.describe Jobs::GrantBadge do subject(:job) { described_class.new } it "schedules a EnsureBadgeConsistency job" do - # Keep only 2 enabled badges to be fast + # Keep the test fast by only enabling 2 badges badge_ids = Badge.enabled.limit(2).pluck(:id) Badge.where.not(id: badge_ids).update_all(enabled: false) - # Ensures it starts a new batch of `GrantBadge` jobs + # Ensures it starts a new batch of GrantBadge jobs Jobs::GrantAllBadges.new.execute({}) expect(Jobs::GrantBadge.jobs.map { |job| job["args"][0]["badge_id"] }).to eq(badge_ids)