diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-28 18:14:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-28 18:14:45 +0300 |
commit | 3837dbda3736815b7d6dab0f880698ea0cddef3c (patch) | |
tree | 17428295d82afaf96974536fe1b7b769985e4d3b /spec/workers/web_hook_worker_spec.rb | |
parent | d6ce16a4070112512d792f7ab66fdca4764cbf2c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers/web_hook_worker_spec.rb')
-rw-r--r-- | spec/workers/web_hook_worker_spec.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/workers/web_hook_worker_spec.rb b/spec/workers/web_hook_worker_spec.rb index bbb8844a447..dbdf7a2b978 100644 --- a/spec/workers/web_hook_worker_spec.rb +++ b/spec/workers/web_hook_worker_spec.rb @@ -19,7 +19,16 @@ RSpec.describe WebHookWorker do expect { subject.perform(non_existing_record_id, data, hook_name) }.not_to raise_error end - it 'retrieves recursion detection data, reinstates it, and cleans it from payload', :request_store, :aggregate_failures do + it 'retrieves recursion detection data and reinstates it', :request_store, :aggregate_failures do + uuid = SecureRandom.uuid + params = { recursion_detection_request_uuid: uuid } + + expect_next(WebHookService, project_hook, data.with_indifferent_access, hook_name, anything).to receive(:execute) + expect { subject.perform(project_hook.id, data, hook_name, params) } + .to change { Gitlab::WebHooks::RecursionDetection::UUID.instance.request_uuid }.to(uuid) + end + + it 'retrieves recursion detection data, reinstates it, and cleans it from payload when passed through as data', :request_store, :aggregate_failures do uuid = SecureRandom.uuid full_data = data.merge({ _gitlab_recursion_detection_request_uuid: uuid }) |