diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2018-09-04 23:04:10 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2018-09-06 22:01:48 +0300 |
commit | 460badd8cca3a515bbcae5235c14c09cc907abaf (patch) | |
tree | 9fdb65e562dba755189fc2e5cd61038a4d9d056c /spec/lib/gitlab/git/repository_spec.rb | |
parent | 21096e2391e3e4c5d8e6ab1d430189429847248d (diff) |
Add Gitlab::Git::Repository#find_remote_root_ref
Diffstat (limited to 'spec/lib/gitlab/git/repository_spec.rb')
-rw-r--r-- | spec/lib/gitlab/git/repository_spec.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb index 17348b01006..1098a266140 100644 --- a/spec/lib/gitlab/git/repository_spec.rb +++ b/spec/lib/gitlab/git/repository_spec.rb @@ -583,6 +583,33 @@ describe Gitlab::Git::Repository, :seed_helper do end end + describe '#find_remote_root_ref' do + it 'gets the remote root ref from GitalyClient' do + expect_any_instance_of(Gitlab::GitalyClient::RemoteService) + .to receive(:find_remote_root_ref).and_call_original + + expect(repository.find_remote_root_ref('origin')).to eq 'master' + end + + it 'returns nil when remote name is nil' do + expect_any_instance_of(Gitlab::GitalyClient::RemoteService) + .not_to receive(:find_remote_root_ref) + + expect(repository.find_remote_root_ref(nil)).to be_nil + end + + it 'returns nil when remote name is empty' do + expect_any_instance_of(Gitlab::GitalyClient::RemoteService) + .not_to receive(:find_remote_root_ref) + + expect(repository.find_remote_root_ref('')).to be_nil + end + + it_behaves_like 'wrapping gRPC errors', Gitlab::GitalyClient::RemoteService, :find_remote_root_ref do + subject { repository.find_remote_root_ref('origin') } + end + end + describe "#log" do shared_examples 'repository log' do let(:commit_with_old_name) do |