diff options
Diffstat (limited to 'spec/models/repository_spec.rb')
-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 |