fix: RemoveStaleRedisKeys service (#10562)
Fixes issues with RemoveStaleRedisKeys service Co-authored-by: Sojan <sojan@pepalo.com>
This commit is contained in:
15
spec/jobs/internal/process_stale_redis_keys_job_spec.rb
Normal file
15
spec/jobs/internal/process_stale_redis_keys_job_spec.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Internal::ProcessStaleRedisKeysJob do
|
||||
let(:account) { create(:account) }
|
||||
|
||||
describe '#perform' do
|
||||
it 'calls the RemoveStaleRedisKeysService with the correct account ID' do
|
||||
expect(Internal::RemoveStaleRedisKeysService).to receive(:new)
|
||||
.with(account_id: account.id)
|
||||
.and_call_original
|
||||
|
||||
described_class.perform_now(account)
|
||||
end
|
||||
end
|
||||
end
|
||||
13
spec/jobs/internal/remove_stale_redis_keys_job_spec.rb
Normal file
13
spec/jobs/internal/remove_stale_redis_keys_job_spec.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe Internal::RemoveStaleRedisKeysJob do
|
||||
let(:account) { create(:account) }
|
||||
|
||||
describe '#perform' do
|
||||
it 'enqueues ProcessStaleRedisKeysJob for the account' do
|
||||
expect(Internal::ProcessStaleRedisKeysJob).to receive(:perform_later).with(account)
|
||||
|
||||
described_class.perform_now
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user