diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-07-26 08:27:48 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-07-26 08:27:48 +0000 |
commit | 695f5085a1ff4be571540c3201e26060b46ec522 (patch) | |
tree | b092413fd70e1600bb579583c8ee579e611548a9 /spec/models | |
parent | 121b90aa69946a3ecdb9f1d60eb7d0debeb414f0 (diff) | |
parent | acf4a36b3ed81c952d3f2edbfb054118b1d9dfff (diff) | |
download | gitlab-ce-695f5085a1ff4be571540c3201e26060b46ec522.tar.gz |
Merge branch 'zj-repo-exists-gitaly' into 'master'
Implement GRPC call to RepositoryService
See merge request !13019
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 |