diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-05-02 13:17:51 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-05-02 13:17:51 +0000 |
commit | 780dcf9cdb9a86b83388f34b07485382bf047cfd (patch) | |
tree | a3a15a89476dec9669900e0b36b26dd302a53272 /spec/models | |
parent | 554c4e0d6fda653667c4c7e8f4b2088837636000 (diff) | |
parent | 573d0989110ccb0630481f416d1a4f8fd05ee608 (diff) | |
download | gitlab-ce-780dcf9cdb9a86b83388f34b07485382bf047cfd.tar.gz |
Merge branch 'gitaly-branch-tag-count' into 'master'
Use Gitaly for getting Branch/Tag counts
Closes gitaly#157
See merge request !10780
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/repository_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb index f6846cc1b2f..5216764a82d 100644 --- a/spec/models/repository_spec.rb +++ b/spec/models/repository_spec.rb @@ -1379,12 +1379,22 @@ describe Repository, models: true do describe '#branch_count' do it 'returns the number of branches' do expect(repository.branch_count).to be_an(Integer) + + # NOTE: Until rugged goes away, make sure rugged and gitaly are in sync + rugged_count = repository.raw_repository.rugged.branches.count + + expect(repository.branch_count).to eq(rugged_count) end end describe '#tag_count' do it 'returns the number of tags' do expect(repository.tag_count).to be_an(Integer) + + # NOTE: Until rugged goes away, make sure rugged and gitaly are in sync + rugged_count = repository.raw_repository.rugged.tags.count + + expect(repository.tag_count).to eq(rugged_count) end end |