diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
commit | 3cccd102ba543e02725d247893729e5c73b38295 (patch) | |
tree | f36a04ec38517f5deaaacb5acc7d949688d1e187 /spec/services/web_hook_service_spec.rb | |
parent | 205943281328046ef7b4528031b90fbda70c75ac (diff) |
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'spec/services/web_hook_service_spec.rb')
-rw-r--r-- | spec/services/web_hook_service_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/services/web_hook_service_spec.rb b/spec/services/web_hook_service_spec.rb index c938ad9ee39..b99bc860523 100644 --- a/spec/services/web_hook_service_spec.rb +++ b/spec/services/web_hook_service_spec.rb @@ -107,6 +107,21 @@ RSpec.describe WebHookService, :request_store, :clean_gitlab_redis_shared_state ).once end + context 'when the data is a Gitlab::DataBuilder::Pipeline' do + let(:pipeline) { create(:ci_pipeline, project: project) } + let(:data) { ::Gitlab::DataBuilder::Pipeline.new(pipeline) } + + it 'can log the request payload' do + stub_full_request(project_hook.url, method: :post) + + # we call this with force to ensure that the logs are written inline, + # which tests that we can serialize the data to the DB correctly. + service = described_class.new(project_hook, data, :push_hooks, force: true) + + expect { service.execute }.to change(::WebHookLog, :count).by(1) + end + end + context 'when auth credentials are present' do let_it_be(:url) {'https://example.org'} let_it_be(:project_hook) { create(:project_hook, url: 'https://demo:demo@example.org/') } |