Commit 4463c288 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch...

Merge branch 'al-255316-add-missing-spec-for-update_max_seats_used_for_gitlab_com_subscriptions_worker' into 'master'

Add missing spec for UpdateMaxSeatsUsedForGitlabComSubscriptionsWorker

See merge request gitlab-org/gitlab!44632
parents 621fa38e f42a60ee
...@@ -124,12 +124,21 @@ RSpec.describe UpdateMaxSeatsUsedForGitlabComSubscriptionsWorker do ...@@ -124,12 +124,21 @@ RSpec.describe UpdateMaxSeatsUsedForGitlabComSubscriptionsWorker do
describe '.last_enqueue_time' do describe '.last_enqueue_time' do
it 'returns last_enqueue_time from the cron job instance' do it 'returns last_enqueue_time from the cron job instance' do
time = Time.current time = Time.current
job = double(Sidekiq::Cron::Job, last_enqueue_time: time)
allow(Sidekiq::Cron::Job).to receive(:find) allow(Sidekiq::Cron::Job).to receive(:find)
.with('update_max_seats_used_for_gitlab_com_subscriptions_worker') .with('update_max_seats_used_for_gitlab_com_subscriptions_worker')
.and_return(job) .and_return(double(Sidekiq::Cron::Job, last_enqueue_time: time))
expect(described_class.last_enqueue_time).to eq(time) expect(described_class.last_enqueue_time).to eq(time)
end end
context 'when job is not found' do
it 'returns nil' do
allow(Sidekiq::Cron::Job).to receive(:find)
.with('update_max_seats_used_for_gitlab_com_subscriptions_worker')
.and_return(nil)
expect(described_class.last_enqueue_time).to be_nil
end
end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment