diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 09:55:51 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 09:55:51 +0000 |
commit | e8d2c2579383897a1dd7f9debd359abe8ae8373d (patch) | |
tree | c42be41678c2586d49a75cabce89322082698334 /spec/workers/users | |
parent | fc845b37ec3a90aaa719975f607740c22ba6a113 (diff) | |
download | gitlab-ce-e8d2c2579383897a1dd7f9debd359abe8ae8373d.tar.gz |
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'spec/workers/users')
-rw-r--r-- | spec/workers/users/deactivate_dormant_users_worker_spec.rb | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/spec/workers/users/deactivate_dormant_users_worker_spec.rb b/spec/workers/users/deactivate_dormant_users_worker_spec.rb index 32291a143ee..934c497c79a 100644 --- a/spec/workers/users/deactivate_dormant_users_worker_spec.rb +++ b/spec/workers/users/deactivate_dormant_users_worker_spec.rb @@ -4,12 +4,12 @@ require 'spec_helper' RSpec.describe Users::DeactivateDormantUsersWorker do describe '#perform' do + let_it_be(:dormant) { create(:user, last_activity_on: User::MINIMUM_INACTIVE_DAYS.days.ago.to_date) } + let_it_be(:inactive) { create(:user, last_activity_on: nil) } + subject(:worker) { described_class.new } it 'does not run for GitLab.com' do - create(:user, last_activity_on: User::MINIMUM_INACTIVE_DAYS.days.ago.to_date) - create(:user, last_activity_on: nil) - expect(Gitlab).to receive(:com?).and_return(true) expect(Gitlab::CurrentSettings).not_to receive(:current_application_settings) @@ -29,9 +29,6 @@ RSpec.describe Users::DeactivateDormantUsersWorker do stub_const("#{described_class.name}::BATCH_SIZE", 1) stub_const("#{described_class.name}::PAUSE_SECONDS", 0) - create(:user, last_activity_on: User::MINIMUM_INACTIVE_DAYS.days.ago.to_date) - create(:user, last_activity_on: nil) - expect(worker).to receive(:sleep).twice worker.perform @@ -48,9 +45,6 @@ RSpec.describe Users::DeactivateDormantUsersWorker do end it 'does nothing' do - create(:user, last_activity_on: User::MINIMUM_INACTIVE_DAYS.days.ago.to_date) - create(:user, last_activity_on: nil) - worker.perform expect(User.dormant.count).to eq(1) |