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:
Diffstat (limited to 'spec/lib/gitlab/workhorse_spec.rb')
-rw-r--r--spec/lib/gitlab/workhorse_spec.rb52
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