From 0ea3fcec397b69815975647f5e2aa5fe944a8486 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 20 Jun 2022 11:10:13 +0000 Subject: Add latest changes from gitlab-org/gitlab@15-1-stable-ee --- spec/models/user_spec.rb | 33 +++++++++------------------------ 1 file changed, 9 insertions(+), 24 deletions(-) (limited to 'spec/models/user_spec.rb') diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index f087fab1ef3..dcf6b224009 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -4374,24 +4374,6 @@ RSpec.describe User do it_behaves_like '#ci_owned_runners' end - - context 'when FF ci_owned_runners_cross_joins_fix is disabled' do - before do - skip_if_multiple_databases_are_setup - - stub_feature_flags(ci_owned_runners_cross_joins_fix: false) - end - - it_behaves_like '#ci_owned_runners' - end - - context 'when FF ci_owned_runners_unnest_index is disabled uses GIN index' do - before do - stub_feature_flags(ci_owned_runners_unnest_index: false) - end - - it_behaves_like '#ci_owned_runners' - end end describe '#projects_with_reporter_access_limited_to' do @@ -6655,8 +6637,10 @@ RSpec.describe User do describe '.with_no_activity' do it 'returns users with no activity' do freeze_time do - not_that_long_ago = (described_class::MINIMUM_INACTIVE_DAYS - 1).days.ago.to_date - too_long_ago = described_class::MINIMUM_INACTIVE_DAYS.days.ago.to_date + active_not_that_long_ago = (described_class::MINIMUM_INACTIVE_DAYS - 1).days.ago.to_date + active_too_long_ago = described_class::MINIMUM_INACTIVE_DAYS.days.ago.to_date + created_recently = (described_class::MINIMUM_DAYS_CREATED - 1).days.ago.to_date + created_not_recently = described_class::MINIMUM_DAYS_CREATED.days.ago.to_date create(:user, :deactivated, last_activity_on: nil) @@ -6664,12 +6648,13 @@ RSpec.describe User do create(:user, state: :active, user_type: user_type, last_activity_on: nil) end - create(:user, last_activity_on: not_that_long_ago) - create(:user, last_activity_on: too_long_ago) + create(:user, last_activity_on: active_not_that_long_ago) + create(:user, last_activity_on: active_too_long_ago) + create(:user, last_activity_on: nil, created_at: created_recently) - user_with_no_activity = create(:user, last_activity_on: nil) + old_enough_user_with_no_activity = create(:user, last_activity_on: nil, created_at: created_not_recently) - expect(described_class.with_no_activity).to contain_exactly(user_with_no_activity) + expect(described_class.with_no_activity).to contain_exactly(old_enough_user_with_no_activity) end end end -- cgit v1.2.3