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/services/web_hook_service_spec.rb')
-rw-r--r--spec/services/web_hook_service_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/services/web_hook_service_spec.rb b/spec/services/web_hook_service_spec.rb
index e1954c32227..4ec8922e187 100644
--- a/spec/services/web_hook_service_spec.rb
+++ b/spec/services/web_hook_service_spec.rb
@@ -429,5 +429,19 @@ RSpec.describe WebHookService do
end
end
end
+
+ context 'when hook has custom context attributes' do
+ it 'includes the attributes in the worker context' do
+ expect(WebHookWorker).to receive(:perform_async) do
+ expect(Gitlab::ApplicationContext.current).to include(
+ 'meta.project' => project_hook.project.full_path,
+ 'meta.root_namespace' => project.root_ancestor.path,
+ 'meta.related_class' => 'ProjectHook'
+ )
+ end
+
+ service_instance.async_execute
+ end
+ end
end
end