diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 14:10:13 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-20 14:10:13 +0300 |
commit | 0ea3fcec397b69815975647f5e2aa5fe944a8486 (patch) | |
tree | 7979381b89d26011bcf9bdc989a40fcc2f1ed4ff /spec/requests/api/error_tracking | |
parent | 72123183a20411a36d607d70b12d57c484394c8e (diff) |
Add latest changes from gitlab-org/gitlab@15-1-stable-eev15.1.0-rc42
Diffstat (limited to 'spec/requests/api/error_tracking')
-rw-r--r-- | spec/requests/api/error_tracking/collector_spec.rb | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/spec/requests/api/error_tracking/collector_spec.rb b/spec/requests/api/error_tracking/collector_spec.rb index c0d7eb5460f..dfca994d1c3 100644 --- a/spec/requests/api/error_tracking/collector_spec.rb +++ b/spec/requests/api/error_tracking/collector_spec.rb @@ -106,17 +106,30 @@ RSpec.describe API::ErrorTracking::Collector do end context 'gzip body' do - let(:headers) do + let(:standard_headers) do { 'X-Sentry-Auth' => "Sentry sentry_key=#{client_key.public_key}", - 'HTTP_CONTENT_ENCODING' => 'gzip', - 'CONTENT_TYPE' => 'application/x-sentry-envelope' + 'HTTP_CONTENT_ENCODING' => 'gzip' } end let(:params) { ActiveSupport::Gzip.compress(raw_event) } - it_behaves_like 'successful request' + context 'with application/x-sentry-envelope Content-Type' do + let(:headers) { standard_headers.merge({ 'CONTENT_TYPE' => 'application/x-sentry-envelope' }) } + + it_behaves_like 'successful request' + end + + context 'with unexpected Content-Type' do + let(:headers) { standard_headers.merge({ 'CONTENT_TYPE' => 'application/gzip' }) } + + it 'responds with 415' do + subject + + expect(response).to have_gitlab_http_status(:unsupported_media_type) + end + end end end |