diff options
author | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-02-20 16:05:44 +0300 |
---|---|---|
committer | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-02-20 16:05:44 +0300 |
commit | 2b0e8b86d8aa35ac094d18bfefaa81af916347fa (patch) | |
tree | a0469ccf9e179832b2231c7f2abfa23956a4048f /spec/services/groups | |
parent | 444d71e043eb19979ec1b08504b2760910cb2a47 (diff) | |
parent | c89449e6110c2bdf6e1410bae3e7b7d807c5e305 (diff) |
Merge branch 'master' into zj-create-mattermost-team
Diffstat (limited to 'spec/services/groups')
-rw-r--r-- | spec/services/groups/destroy_service_spec.rb | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/spec/services/groups/destroy_service_spec.rb b/spec/services/groups/destroy_service_spec.rb index f86189b68e9..32c2ed8cae7 100644 --- a/spec/services/groups/destroy_service_spec.rb +++ b/spec/services/groups/destroy_service_spec.rb @@ -9,14 +9,18 @@ describe Groups::DestroyService, services: true do let!(:gitlab_shell) { Gitlab::Shell.new } let!(:remove_path) { group.path + "+#{group.id}+deleted" } + before do + group.add_user(user, Gitlab::Access::OWNER) + end + shared_examples 'group destruction' do |async| context 'database records' do before do destroy_group(group, user, async) end - it { expect(Group.all).not_to include(group) } - it { expect(Project.all).not_to include(project) } + it { expect(Group.unscoped.all).not_to include(group) } + it { expect(Project.unscoped.all).not_to include(project) } end context 'file system' do @@ -32,7 +36,7 @@ describe Groups::DestroyService, services: true do context 'Sidekiq fake' do before do - # Dont run sidekiq to check if renamed repository exists + # Don't run sidekiq to check if renamed repository exists Sidekiq::Testing.fake! { destroy_group(group, user, async) } end @@ -95,4 +99,13 @@ describe Groups::DestroyService, services: true do describe 'synchronous delete' do it_behaves_like 'group destruction', false end + + context 'projects in pending_delete' do + before do + project.pending_delete = true + project.save + end + + it_behaves_like 'group destruction', false + end end |