Skip to content

Commit 3ef8fc8

Browse files
committed
Fixed a bug where the job would be enqueued ~58 hours in the future
1 parent 873dd7c commit 3ef8fc8

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

app/workers/activate_pending_users_worker.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ class ActivatePendingUsersWorker
22
include Sidekiq::Worker
33
sidekiq_options queue: :critical
44

5-
65
def perform
76
# Spawning possibly many thousands
87
# of workers the order doesn't really matter
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
require 'sidekiq/testing'
2+
Sidekiq::Testing.inline!
3+
4+
RSpec.describe ActivatePendingUsersWorker do
5+
end

spec/workers/user_activate_worker_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
it 'should activate user' do
1919
worker.perform(user.id)
2020
user.reload
21-
21+
2222
expect(user.active?).to eq(true)
2323
expect(user.activated_on).not_to eq(nil)
2424
end
@@ -30,7 +30,7 @@
3030
it 'should do nothing' do
3131
worker.perform(user.id)
3232
user.reload
33-
33+
3434
expect(user.updated_at).to eq(user.created_at)
3535
end
3636
end

0 commit comments

Comments
 (0)