diff options
Diffstat (limited to 'spec/lib/gitlab/gitaly_client/ref_service_spec.rb')
-rw-r--r-- | spec/lib/gitlab/gitaly_client/ref_service_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/lib/gitlab/gitaly_client/ref_service_spec.rb b/spec/lib/gitlab/gitaly_client/ref_service_spec.rb index bd96e9baf1d..b413c47e033 100644 --- a/spec/lib/gitlab/gitaly_client/ref_service_spec.rb +++ b/spec/lib/gitlab/gitaly_client/ref_service_spec.rb @@ -102,6 +102,16 @@ RSpec.describe Gitlab::GitalyClient::RefService do client.find_branch('name') end + + context 'when Gitaly returns a ambiguios reference error' do + it 'raises an UnknownRef error' do + expect_any_instance_of(Gitaly::RefService::Stub) + .to receive(:find_branch) + .and_raise(GRPC::BadStatus.new(2, 'reference is ambiguous')) + + expect { client.find_branch('name') }.to raise_error(Gitlab::Git::AmbiguousRef, 'branch is ambiguous: name') + end + end end describe '#find_tag' do |