diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 14:34:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-20 14:34:42 +0000 |
commit | 9f46488805e86b1bc341ea1620b866016c2ce5ed (patch) | |
tree | f9748c7e287041e37d6da49e0a29c9511dc34768 /spec/workers/concerns | |
parent | dfc92d081ea0332d69c8aca2f0e745cb48ae5e6d (diff) | |
download | gitlab-ce-9f46488805e86b1bc341ea1620b866016c2ce5ed.tar.gz |
Add latest changes from gitlab-org/gitlab@13-0-stable-ee
Diffstat (limited to 'spec/workers/concerns')
-rw-r--r-- | spec/workers/concerns/application_worker_spec.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/workers/concerns/application_worker_spec.rb b/spec/workers/concerns/application_worker_spec.rb index 2fbaaf1131f..ae311a54cd1 100644 --- a/spec/workers/concerns/application_worker_spec.rb +++ b/spec/workers/concerns/application_worker_spec.rb @@ -21,6 +21,21 @@ describe ApplicationWorker do end end + describe '#logging_extras' do + it 'returns extra data to be logged that was set from #log_extra_metadata_on_done' do + instance.log_extra_metadata_on_done(:key1, "value1") + instance.log_extra_metadata_on_done(:key2, "value2") + + expect(instance.logging_extras).to eq({ 'extra.gitlab_foo_bar_dummy_worker.key1' => "value1", 'extra.gitlab_foo_bar_dummy_worker.key2' => "value2" }) + end + + context 'when nothing is set' do + it 'returns {}' do + expect(instance.logging_extras).to eq({}) + end + end + end + describe '#structured_payload' do let(:payload) { {} } |