diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-27 22:02:28 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-07-27 22:02:34 +0300 |
commit | 9b60052467242bbc071bcb0f74b7437fb3dfc870 (patch) | |
tree | f6426a3d6b62ad0e33be45bcdef6ae6bae4d34b4 /spec/services/groups | |
parent | 1ff28a8d8d370efef8bbac2da1edb85b758d4643 (diff) |
Add latest changes from gitlab-org/security/gitlab@15-2-stable-ee
Diffstat (limited to 'spec/services/groups')
-rw-r--r-- | spec/services/groups/destroy_service_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/services/groups/destroy_service_spec.rb b/spec/services/groups/destroy_service_spec.rb index 57a151efda6..f43f64fdf89 100644 --- a/spec/services/groups/destroy_service_spec.rb +++ b/spec/services/groups/destroy_service_spec.rb @@ -35,6 +35,20 @@ RSpec.describe Groups::DestroyService do it { expect(NotificationSetting.unscoped.all).not_to include(notification_setting) } end + context 'bot tokens', :sidekiq_might_not_need_inline do + it 'removes group bot', :aggregate_failures do + bot = create(:user, :project_bot) + group.add_developer(bot) + token = create(:personal_access_token, user: bot) + + 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 + end + context 'mattermost team', :sidekiq_might_not_need_inline do let!(:chat_team) { create(:chat_team, namespace: group) } |