Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/gitaly_client/ref_service_spec.rb')
-rw-r--r--spec/lib/gitlab/gitaly_client/ref_service_spec.rb32
1 files changed, 10 insertions, 22 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..ae2e343377d 100644
--- a/spec/lib/gitlab/gitaly_client/ref_service_spec.rb
+++ b/spec/lib/gitlab/gitaly_client/ref_service_spec.rb
@@ -71,28 +71,6 @@ RSpec.describe Gitlab::GitalyClient::RefService do
end
end
- describe '#branch_names' do
- it 'sends a find_all_branch_names message' do
- expect_any_instance_of(Gitaly::RefService::Stub)
- .to receive(:find_all_branch_names)
- .with(gitaly_request_with_path(storage_name, relative_path), kind_of(Hash))
- .and_return([])
-
- client.branch_names
- end
- end
-
- describe '#tag_names' do
- it 'sends a find_all_tag_names message' do
- expect_any_instance_of(Gitaly::RefService::Stub)
- .to receive(:find_all_tag_names)
- .with(gitaly_request_with_path(storage_name, relative_path), kind_of(Hash))
- .and_return([])
-
- client.tag_names
- end
- end
-
describe '#find_branch' do
it 'sends a find_branch message' do
expect_any_instance_of(Gitaly::RefService::Stub)
@@ -102,6 +80,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