diff options
Diffstat (limited to 'spec/services/groups/destroy_service_spec.rb')
-rw-r--r-- | spec/services/groups/destroy_service_spec.rb | 40 |
1 files changed, 10 insertions, 30 deletions
diff --git a/spec/services/groups/destroy_service_spec.rb b/spec/services/groups/destroy_service_spec.rb index 36e868fa5f1..f2dbb69f855 100644 --- a/spec/services/groups/destroy_service_spec.rb +++ b/spec/services/groups/destroy_service_spec.rb @@ -36,37 +36,17 @@ RSpec.describe Groups::DestroyService do end context 'bot tokens', :sidekiq_inline do - context 'when user_destroy_with_limited_execution_time_worker is enabled' do - it 'initiates group bot removal', :aggregate_failures do - bot = create(:user, :project_bot) - group.add_developer(bot) - create(:personal_access_token, user: bot) - - destroy_group(group, user, async) - - expect( - Users::GhostUserMigration.where(user: bot, - initiator_user: user) - ).to be_exists - end - end - - 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 - - it 'removes group bot', :aggregate_failures do - bot = create(:user, :project_bot) - group.add_developer(bot) - token = create(:personal_access_token, user: bot) + it 'initiates group bot removal', :aggregate_failures do + bot = create(:user, :project_bot) + group.add_developer(bot) + create(:personal_access_token, user: bot) - destroy_group(group, user, async) + destroy_group(group, user, async) - expect(PersonalAccessToken.find_by(id: token.id)).to be_nil - expect(User.find_by(id: bot.id)).to be_nil - expect(User.find_by(id: user.id)).not_to be_nil - end + expect( + Users::GhostUserMigration.where(user: bot, + initiator_user: user) + ).to be_exists end end @@ -146,7 +126,7 @@ RSpec.describe Groups::DestroyService do end expect { destroy_group(group, user, false) } - .to raise_error(Groups::DestroyService::DestroyError, "Project #{project.id} can't be deleted" ) + .to raise_error(Groups::DestroyService::DestroyError, "Project #{project.id} can't be deleted") end end |