diff options
author | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-07-21 09:36:31 +0200 |
---|---|---|
committer | Z.J. van de Weg <git@zjvandeweg.nl> | 2017-07-26 09:32:34 +0200 |
commit | acf4a36b3ed81c952d3f2edbfb054118b1d9dfff (patch) | |
tree | 5559cbe8358a143e47778c97e6573ed1634312d2 /spec/models | |
parent | 37056673e4c25db20c70b522985ed8db70625844 (diff) | |
download | gitlab-ce-acf4a36b3ed81c952d3f2edbfb054118b1d9dfff.tar.gz |
Implement GRPC call to RepositoryService
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/repository_spec.rb | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb index 7635b0868e7..fcda4248446 100644 --- a/spec/models/repository_spec.rb +++ b/spec/models/repository_spec.rb @@ -956,21 +956,25 @@ describe Repository, models: true do end end - describe '#exists?' do + shared_examples 'repo exists check' do it 'returns true when a repository exists' do expect(repository.exists?).to eq(true) end - it 'returns false when a repository does not exist' do - allow(repository).to receive(:refs_directory_exists?).and_return(false) + it 'returns false if no full path can be constructed' do + allow(repository).to receive(:path_with_namespace).and_return(nil) expect(repository.exists?).to eq(false) end + end - it 'returns false when there is no namespace' do - allow(repository).to receive(:path_with_namespace).and_return(nil) + describe '#exists?' do + context 'when repository_exists is disabled' do + it_behaves_like 'repo exists check' + end - expect(repository.exists?).to eq(false) + context 'when repository_exists is enabled', skip_gitaly_mock: true do + it_behaves_like 'repo exists check' end end |