diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-10-17 15:42:05 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-10-17 15:42:05 +0000 |
commit | 85d8ab52ca27c5bcd9036aa81a9f0ace9794ee0d (patch) | |
tree | b07cf7ed37b00d06c1b20f3bc9e9a3106bb7068a /spec | |
parent | 2a1646b5a64578be7c1a484227d530e9d37921fe (diff) | |
parent | 2c0b677604e438b9bf608e6ea17b47e5640b4700 (diff) | |
download | gitlab-ce-85d8ab52ca27c5bcd9036aa81a9f0ace9794ee0d.tar.gz |
Merge branch 'bvl-fix-deleting-forked-projects' into 'master'
Fix errors when deleting a forked project
Closes #39196
See merge request gitlab-org/gitlab-ce!14916
Diffstat (limited to 'spec')
-rw-r--r-- | spec/services/projects/destroy_service_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/services/projects/destroy_service_spec.rb b/spec/services/projects/destroy_service_spec.rb index c90bad46295..0bec2054f50 100644 --- a/spec/services/projects/destroy_service_spec.rb +++ b/spec/services/projects/destroy_service_spec.rb @@ -1,6 +1,8 @@ require 'spec_helper' describe Projects::DestroyService do + include ProjectForksHelper + let!(:user) { create(:user) } let!(:project) { create(:project, :repository, namespace: user.namespace) } let!(:path) { project.repository.path_to_repo } @@ -212,6 +214,21 @@ describe Projects::DestroyService do end end + context 'for a forked project with LFS objects' do + let(:forked_project) { fork_project(project, user) } + + before do + project.lfs_objects << create(:lfs_object) + forked_project.forked_project_link.destroy + forked_project.reload + end + + it 'destroys the fork' do + expect { destroy_project(forked_project, user) } + .not_to raise_error + end + end + context 'as the root of a fork network' do let!(:fork_network) { create(:fork_network, root_project: project) } |