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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-08-12 18:10:02 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-08-12 18:10:02 +0300
commitf6a3028be7c20cd509685258ba7e50d9d6a68114 (patch)
tree82960188ccaca3f08a3b3e45b33010ad523230cc /spec/services/web_hook_service_spec.rb
parent999f47e9e6da399de9dc1de404f073f7dd30af0d (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/web_hook_service_spec.rb')
-rw-r--r--spec/services/web_hook_service_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/services/web_hook_service_spec.rb b/spec/services/web_hook_service_spec.rb
index 02d36ed5aba..b7b81d33c3e 100644
--- a/spec/services/web_hook_service_spec.rb
+++ b/spec/services/web_hook_service_spec.rb
@@ -130,6 +130,14 @@ RSpec.describe WebHookService do
end
end
+ context 'when request body size is too big' do
+ it 'does not perform the request' do
+ stub_const("#{described_class}::REQUEST_BODY_SIZE_LIMIT", 10.bytes)
+
+ expect(service_instance.execute).to eq({ status: :error, message: "Gitlab::Json::LimitedEncoder::LimitExceeded" })
+ end
+ end
+
it 'handles 200 status code' do
stub_full_request(project_hook.url, method: :post).to_return(status: 200, body: 'Success')