diff options
author | John Cai <jcai@gitlab.com> | 2019-02-11 21:18:48 +0300 |
---|---|---|
committer | John Cai <jcai@gitlab.com> | 2019-02-11 23:58:37 +0300 |
commit | b9c19e2f1378c8e8647a55f4707186a4995f3f9c (patch) | |
tree | 49203de482972160052ed19e3aff0b53a2d73672 /spec/models | |
parent | bac1f72c5750fa54d712411a6a3ade71dd67b673 (diff) |
Adding convenience method to project model
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/project_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 7b364395faf..1f9088c2e6b 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -4602,6 +4602,21 @@ describe Project do 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 + end + + 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 + end + end + def rugged_config rugged_repo(project.repository).config end |