diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-07-09 09:42:30 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2018-07-09 09:42:30 +0000 |
commit | 1a78483b49a744892743b9b13a118fe7353031e8 (patch) | |
tree | e86538005580397de1179fae5434cf555b2c9f29 /spec | |
parent | c17e9a63606f552b75ee6b1aff8b96cd1d5116e0 (diff) | |
parent | b012abee8bc6fc183d3b5f4f6bc009726d52e285 (diff) | |
download | gitlab-ce-1a78483b49a744892743b9b13a118fe7353031e8.tar.gz |
Merge branch 'gitaly-diff-mandatory' into 'master'
Make all Gitaly diff flags mandatory
Closes gitaly#528 and gitaly#222
See merge request gitlab-org/gitlab-ce!20424
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/workhorse_spec.rb | 42 |
1 files changed, 15 insertions, 27 deletions
diff --git a/spec/lib/gitlab/workhorse_spec.rb b/spec/lib/gitlab/workhorse_spec.rb index 660671cefaf..570580e0cfc 100644 --- a/spec/lib/gitlab/workhorse_spec.rb +++ b/spec/lib/gitlab/workhorse_spec.rb @@ -143,34 +143,22 @@ describe Gitlab::Workhorse do let(:diff_refs) { double(base_sha: "base", head_sha: "head") } subject { described_class.send_git_diff(repository, diff_refs) } - context 'when Gitaly workhorse_send_git_diff feature is enabled' do - it 'sets the header correctly' do - key, command, params = decode_workhorse_header(subject) - - expect(key).to eq("Gitlab-Workhorse-Send-Data") - expect(command).to eq("git-diff") - expect(params).to eq({ - 'GitalyServer' => { - address: Gitlab::GitalyClient.address(project.repository_storage), - token: Gitlab::GitalyClient.token(project.repository_storage) - }, - 'RawDiffRequest' => Gitaly::RawDiffRequest.new( - repository: repository.gitaly_repository, - left_commit_id: 'base', - right_commit_id: 'head' - ).to_json - }.deep_stringify_keys) - end - end - - context 'when Gitaly workhorse_send_git_diff feature is disabled', :disable_gitaly do - it 'sets the header correctly' do - key, command, params = decode_workhorse_header(subject) + it 'sets the header correctly' do + key, command, params = decode_workhorse_header(subject) - expect(key).to eq("Gitlab-Workhorse-Send-Data") - expect(command).to eq("git-diff") - expect(params).to eq("RepoPath" => repository.path_to_repo, "ShaFrom" => "base", "ShaTo" => "head") - end + expect(key).to eq("Gitlab-Workhorse-Send-Data") + expect(command).to eq("git-diff") + expect(params).to eq({ + 'GitalyServer' => { + address: Gitlab::GitalyClient.address(project.repository_storage), + token: Gitlab::GitalyClient.token(project.repository_storage) + }, + 'RawDiffRequest' => Gitaly::RawDiffRequest.new( + repository: repository.gitaly_repository, + left_commit_id: 'base', + right_commit_id: 'head' + ).to_json + }.deep_stringify_keys) end end |