summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2019-01-11 13:04:12 +0000
committerDouwe Maan <douwe@gitlab.com>2019-01-11 13:04:12 +0000
commit0f71b4bcb3870710ae821ea111894fc7d95f2a1c (patch)
treef06adde04e8c333309874a3a19b06ee5777bf0d5 /spec/models
parente593e14a101b5342ad1f502fb086c89329bb9c68 (diff)
parente672ed849484d5ff830ebfe4e3c32b984a6902f2 (diff)
downloadgitlab-ce-0f71b4bcb3870710ae821ea111894fc7d95f2a1c.tar.gz
Merge branch 'zj-nillify-pool-repo-when-leaving' into 'master'
Nullify pool_repository when a project leaves See merge request gitlab-org/gitlab-ce!24225
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/project_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index ffbf0960c95..64fbc49913e 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -4443,6 +4443,17 @@ describe Project do
end
end
+ describe '#leave_pool_repository' do
+ let(:pool) { create(:pool_repository) }
+ let(:project) { create(:project, :repository, pool_repository: pool) }
+
+ it 'removes the membership' do
+ project.leave_pool_repository
+
+ expect(pool.member_projects.reload).not_to include(project)
+ end
+ end
+
def rugged_config
rugged_repo(project.repository).config
end