diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
commit | 6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch) | |
tree | dc4d20fe6064752c0bd323187252c77e0a89144b /spec/support/shared_examples/requests/access_tokens_controller_shared_examples.rb | |
parent | 9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff) |
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
Diffstat (limited to 'spec/support/shared_examples/requests/access_tokens_controller_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/requests/access_tokens_controller_shared_examples.rb | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/spec/support/shared_examples/requests/access_tokens_controller_shared_examples.rb b/spec/support/shared_examples/requests/access_tokens_controller_shared_examples.rb index 6cd871d354c..017e6274cb0 100644 --- a/spec/support/shared_examples/requests/access_tokens_controller_shared_examples.rb +++ b/spec/support/shared_examples/requests/access_tokens_controller_shared_examples.rb @@ -108,18 +108,31 @@ RSpec.shared_examples 'PUT resource access tokens available' do expect(resource.reload.bots).not_to include(bot_user) end - it 'converts issuables of the bot user to ghost user' do - issue = create(:issue, author: bot_user) + context 'when user_destroy_with_limited_execution_time_worker is enabled' do + it 'creates GhostUserMigration records to handle migration in a worker' do + expect { subject }.to( + change { Users::GhostUserMigration.count }.from(0).to(1)) + end + end - subject + context 'when user_destroy_with_limited_execution_time_worker is disabled' do + before do + stub_feature_flags(user_destroy_with_limited_execution_time_worker: false) + end - expect(issue.reload.author.ghost?).to be true - end + it 'converts issuables of the bot user to ghost user' do + issue = create(:issue, author: bot_user) - it 'deletes project bot user' do - subject + subject + + expect(issue.reload.author.ghost?).to be true + end - expect(User.exists?(bot_user.id)).to be_falsy + it 'deletes project bot user' do + subject + + expect(User.exists?(bot_user.id)).to be_falsy + end end context 'when unsuccessful' do |