diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-19 15:08:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-19 15:08:21 +0300 |
commit | 553a22402b0c176b0486cac0009af085122c00f3 (patch) | |
tree | 06602864e1778180f3db5d43c56e89882861bc27 /spec/workers | |
parent | 57d1bb82549c6713f87f87d5f35eec3d867c83db (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers')
-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) { {} } |