summaryrefslogtreecommitdiff
path: root/spec/controllers
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-12-07 15:29:00 +0000
committerStan Hu <stanhu@gmail.com>2018-12-07 15:29:00 +0000
commite17ccef5cadd7b8962a10bb43b1332658a54bd96 (patch)
tree05288b33ef4b4965e38a12c629041a4a6ad9d619 /spec/controllers
parentcda291f0c35d3724d2df916fcd95e00e84f469cf (diff)
parenteb33ca49b8a402b347592c6cf982fb7619218370 (diff)
downloadgitlab-ce-e17ccef5cadd7b8962a10bb43b1332658a54bd96.tar.gz
Merge branch 'store-correlation-logs' into 'master'
Log and pass correlation-id between Unicorn, Sidekiq and Gitaly See merge request gitlab-org/gitlab-ce!22844
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/application_controller_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb
index ac92b2ca657..c2bd7fd9808 100644
--- a/spec/controllers/application_controller_spec.rb
+++ b/spec/controllers/application_controller_spec.rb
@@ -460,6 +460,14 @@ describe ApplicationController do
expect(controller.last_payload.has_key?(:response)).to be_falsey
end
+ it 'does log correlation id' do
+ Gitlab::CorrelationId.use_id('new-id') do
+ get :index
+ end
+
+ expect(controller.last_payload).to include('correlation_id' => 'new-id')
+ end
+
context '422 errors' do
it 'logs a response with a string' do
response = spy(ActionDispatch::Response, status: 422, body: 'Hello world', content_type: 'application/json', cookies: {})