GitLab wird am Donnerstag, den 27. Januar, zwischen 08:00 und 12:00 Uhr wegen wichtigen Wartungsarbeiten nicht zur Verfügung stehen.

Commit b9c19e2f authored by John Cai's avatar John Cai
Browse files

Adding convenience method to project model

parent bac1f72c
...@@ -2073,6 +2073,10 @@ def link_pool_repository ...@@ -2073,6 +2073,10 @@ def link_pool_repository
pool_repository&.link_repository(repository) pool_repository&.link_repository(repository)
end end
def has_pool_repository?
private private
def merge_requests_allowing_collaboration(source_branch = nil) def merge_requests_allowing_collaboration(source_branch = nil)
...@@ -4602,6 +4602,21 @@ def domain_variable ...@@ -4602,6 +4602,21 @@ def domain_variable
end end
end end
describe '#has_pool_repsitory?' do
it 'returns false when it does not have a pool repository' do
subject = create(:project, :repository)
expect(subject.has_pool_repository?).to be false
it 'returns true when it has a pool repository' do
pool = create(:pool_repository, :ready)
subject = create(:project, :repository, pool_repository: pool)
expect(subject.has_pool_repository?).to be true
def rugged_config def rugged_config
rugged_repo(project.repository).config rugged_repo(project.repository).config
end end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment