Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-07-05 15:08:33 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-05 15:08:33 +0300
commite8fc7f565017d915278fd0efbcff2f81b7e94093 (patch)
tree4b9fc9318e0179f04934a27c57a9e1bb570df856 /spec/workers/users
parentcf98b5d69a84324cad0f23b786a0ec0937c90944 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers/users')
-rw-r--r--spec/workers/users/deactivate_dormant_users_worker_spec.rb12
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)