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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-12-04 09:09:34 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-12-04 09:09:34 +0300
commita2f16969fa9bb982d5ec01f18efff5eabfc89a67 (patch)
tree881f7d8db86c1758fd21c070908a26b3d1d032c8 /spec/lib/gitlab/gitaly_client/commit_service_spec.rb
parentedf27428120b9726e34e577e5b1d3371c74baf1d (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.rb25
1 files changed, 25 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 36f7d89dd0f..157c2393ce1 100644
--- a/spec/lib/gitlab/gitaly_client/commit_service_spec.rb
+++ b/spec/lib/gitlab/gitaly_client/commit_service_spec.rb
@@ -145,6 +145,31 @@ RSpec.describe Gitlab::GitalyClient::CommitService do
end
end
+ describe '#find_changed_paths' do
+ let(:commits) { %w[1a0b36b3cdad1d2ee32457c102a8c0b7056fa863 cfe32cf61b73a0d5e9f13e774abde7ff789b1660] }
+
+ it 'sends an RPC request and returns the stats' do
+ request = Gitaly::FindChangedPathsRequest.new(repository: repository_message,
+ commits: commits)
+
+ changed_paths_response = Gitaly::FindChangedPathsResponse.new(
+ paths: [{
+ path: "app/assets/javascripts/boards/components/project_select.vue",
+ status: :MODIFIED
+ }])
+
+ expect_any_instance_of(Gitaly::DiffService::Stub).to receive(:find_changed_paths)
+ .with(request, kind_of(Hash)).and_return([changed_paths_response])
+
+ returned_value = described_class.new(repository).find_changed_paths(commits)
+
+ mapped_returned_value = returned_value.map(&:to_h)
+ mapped_expected_value = changed_paths_response.paths.map(&:to_h)
+
+ expect(mapped_returned_value).to eq(mapped_expected_value)
+ end
+ end
+
describe '#tree_entries' do
let(:path) { '/' }