diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /spec/lib/gitlab/workhorse_spec.rb | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/lib/gitlab/workhorse_spec.rb')
-rw-r--r-- | spec/lib/gitlab/workhorse_spec.rb | 52 |
1 files changed, 9 insertions, 43 deletions
diff --git a/spec/lib/gitlab/workhorse_spec.rb b/spec/lib/gitlab/workhorse_spec.rb index 3bab9aec454..703a4b5399e 100644 --- a/spec/lib/gitlab/workhorse_spec.rb +++ b/spec/lib/gitlab/workhorse_spec.rb @@ -244,15 +244,13 @@ RSpec.describe Gitlab::Workhorse do GitalyServer: { features: { 'gitaly-feature-enforce-requests-limits' => 'true' }, address: Gitlab::GitalyClient.address('default'), - token: Gitlab::GitalyClient.token('default'), - sidechannel: false + token: Gitlab::GitalyClient.token('default') } } end before do allow(Gitlab.config.gitaly).to receive(:enabled).and_return(true) - stub_feature_flags(workhorse_use_sidechannel: false) end it 'includes a Repository param' do @@ -334,46 +332,6 @@ RSpec.describe Gitlab::Workhorse do it { expect { subject }.to raise_exception('Unsupported action: download') } end - - context 'when workhorse_use_sidechannel flag is set' do - context 'when a feature flag is set globally' do - before do - stub_feature_flags(workhorse_use_sidechannel: true) - end - - it 'sets the flag to true' do - response = described_class.git_http_ok(repository, Gitlab::GlRepository::PROJECT, user, action) - - expect(response.dig(:GitalyServer, :sidechannel)).to eq(true) - end - end - - context 'when a feature flag is set for a single project' do - before do - stub_feature_flags(workhorse_use_sidechannel: project) - end - - it 'sets the flag to true for that project' do - response = described_class.git_http_ok(repository, Gitlab::GlRepository::PROJECT, user, action) - - expect(response.dig(:GitalyServer, :sidechannel)).to eq(true) - end - - it 'sets the flag to false for other projects' do - other_project = create(:project, :public, :repository) - response = described_class.git_http_ok(other_project.repository, Gitlab::GlRepository::PROJECT, user, action) - - expect(response.dig(:GitalyServer, :sidechannel)).to eq(false) - end - - it 'sets the flag to false when there is no project' do - snippet = create(:personal_snippet, :repository) - response = described_class.git_http_ok(snippet.repository, Gitlab::GlRepository::SNIPPET, user, action) - - expect(response.dig(:GitalyServer, :sidechannel)).to eq(false) - end - end - end end context 'when receive_max_input_size has been updated' do @@ -448,6 +406,14 @@ RSpec.describe Gitlab::Workhorse do end end + describe '.detect_content_type' do + subject { described_class.detect_content_type } + + it 'returns array setting detect content type in workhorse' do + expect(subject).to eq(%w[Gitlab-Workhorse-Detect-Content-Type true]) + end + end + describe '.send_git_blob' do include FakeBlobHelpers |