diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-08-23 13:39:01 +0300 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-08-23 13:39:01 +0300 |
commit | d546f7d36e6703bda430e2f50fe4e87a07ab48f8 (patch) | |
tree | 2f146ced371825eb0ac5e6450bd9c37e4fff9896 /spec/lib/gitlab/gitaly_client | |
parent | 1f456ff3649e0a26785aaddf979bb8ce0d56f17a (diff) | |
parent | 258d5a50e63d5e29b6a3adc0a250727a8232695b (diff) |
Merge branch 'gitaly-commit-patch' into 'master'
Incorporate DiffService.CommitPatch Gitaly RPC
Closes gitaly#463
See merge request !13441
Diffstat (limited to 'spec/lib/gitlab/gitaly_client')
-rw-r--r-- | spec/lib/gitlab/gitaly_client/commit_service_spec.rb | 25 |
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 2eaf4222964..f32fe5d8150 100644 --- a/spec/lib/gitlab/gitaly_client/commit_service_spec.rb +++ b/spec/lib/gitlab/gitaly_client/commit_service_spec.rb @@ -140,4 +140,29 @@ describe Gitlab::GitalyClient::CommitService do described_class.new(repository).find_commit(revision) end end + + describe '#patch' do + let(:request) do + Gitaly::CommitPatchRequest.new( + repository: repository_message, revision: revision + ) + end + let(:response) { [double(data: "my "), double(data: "diff")] } + + subject { described_class.new(repository).patch(revision) } + + it 'sends an RPC request' do + expect_any_instance_of(Gitaly::DiffService::Stub).to receive(:commit_patch) + .with(request, kind_of(Hash)).and_return([]) + + subject + end + + it 'concatenates the responses data' do + allow_any_instance_of(Gitaly::DiffService::Stub).to receive(:commit_patch) + .with(request, kind_of(Hash)).and_return(response) + + expect(subject).to eq("my diff") + end + end end |