Commit 573d0989 authored by Kim "BKC" Carlbäcker's avatar Kim "BKC" Carlbäcker

Cleanup

parent a998710a
......@@ -505,10 +505,8 @@ class Repository
delegate :tag_names, to: :raw_repository
cache_method :tag_names, fallback: []
delegate :branch_count, to: :raw_repository
delegate :branch_count, :tag_count, to: :raw_repository
cache_method :branch_count, fallback: 0
delegate :tag_count, to: :raw_repository
cache_method :tag_count, fallback: 0
def avatar
......
......@@ -1379,7 +1379,10 @@ 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
......@@ -1387,8 +1390,10 @@ describe Repository, models: true do
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
......
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