Apply suggestions
This commit is contained in:
parent
4029a2e870
commit
d26251628d
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue