diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-01-25 09:35:54 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-01-25 09:35:54 +0000 |
commit | 0f2a906211dcbf4978b465d342521dda14ade729 (patch) | |
tree | 601af1737f9424d416ae1f16cea9a1f727479541 /spec/models | |
parent | 07ee83932fb755f4e0c89ba3bf172a6ae728d601 (diff) | |
parent | 0689663487c66d21aa83da0830bc2c042f89e6e8 (diff) | |
download | gitlab-ce-0f2a906211dcbf4978b465d342521dda14ade729.tar.gz |
Merge branch 'update-gitlab-git' into 'master'
Update gitlab_git & use new method for counting branches
Corresponding gitlab_git merge request detailing some of the rationale behind this: https://gitlab.com/gitlab-org/gitlab_git/merge_requests/62
Fixes #12418
See merge request !2535
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/repository_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb index afbf62035ac..c484ae8fc8c 100644 --- a/spec/models/repository_spec.rb +++ b/spec/models/repository_spec.rb @@ -219,4 +219,24 @@ describe Repository, models: true do end end end + + describe '#has_visible_content?' do + subject { repository.has_visible_content? } + + describe 'when there are no branches' do + before do + allow(repository.raw_repository).to receive(:branch_count).and_return(0) + end + + it { is_expected.to eq(false) } + end + + describe 'when there are branches' do + before do + allow(repository.raw_repository).to receive(:branch_count).and_return(3) + end + + it { is_expected.to eq(true) } + end + end end |