diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-19 15:10:08 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-19 15:10:08 +0300 |
commit | 1072f96e340ddad78e5dad6dfedc7c6e85fc53ea (patch) | |
tree | 573525bb3525f79cbb011f39ad11c11c6efea315 /spec/lib/gitlab/gitaly_client/commit_service_spec.rb | |
parent | 8cc0a0aa965798e74826197d350472d235af2f84 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/gitaly_client/commit_service_spec.rb')
-rw-r--r-- | spec/lib/gitlab/gitaly_client/commit_service_spec.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/lib/gitlab/gitaly_client/commit_service_spec.rb b/spec/lib/gitlab/gitaly_client/commit_service_spec.rb index ac4c42d57ee..22c29403255 100644 --- a/spec/lib/gitlab/gitaly_client/commit_service_spec.rb +++ b/spec/lib/gitlab/gitaly_client/commit_service_spec.rb @@ -287,6 +287,39 @@ RSpec.describe Gitlab::GitalyClient::CommitService do end end + describe '#list_commits' do + shared_examples 'a ListCommits request' do + before do + ::Gitlab::GitalyClient.clear_stubs! + end + + it 'sends a list_commits message' do + expect_next_instance_of(Gitaly::CommitService::Stub) do |service| + expect(service) + .to receive(:list_commits) + .with(gitaly_request_with_params(expected_params), kind_of(Hash)) + .and_return([]) + end + + client.list_commits(revisions) + end + end + + context 'with a single revision' do + let(:revisions) { 'master' } + let(:expected_params) { %w[master] } + + it_behaves_like 'a ListCommits request' + end + + context 'with multiple revisions' do + let(:revisions) { %w[master --not --all] } + let(:expected_params) { %w[master --not --all] } + + it_behaves_like 'a ListCommits request' + end + end + describe '#commit_stats' do let(:request) do Gitaly::CommitStatsRequest.new( |