diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-05 15:07:52 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-05 15:07:52 +0000 |
commit | afe2b984524ae4b0c8a0636db7ec5b2c452f0734 (patch) | |
tree | 3de39f954c7239e09a9afe84263a64e7042b2b60 /spec/controllers/application_controller_spec.rb | |
parent | 5a6b36b60502c50ab59c0bc3c345793b70a3d548 (diff) | |
download | gitlab-ce-afe2b984524ae4b0c8a0636db7ec5b2c452f0734.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers/application_controller_spec.rb')
-rw-r--r-- | spec/controllers/application_controller_spec.rb | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb index 90f6697a8c0..4a3d591e94d 100644 --- a/spec/controllers/application_controller_spec.rb +++ b/spec/controllers/application_controller_spec.rb @@ -530,41 +530,6 @@ describe ApplicationController do 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: {}) - allow(controller).to receive(:response).and_return(response) - get :index - - expect(controller.last_payload[:response]).to eq('Hello world') - end - - it 'logs a response with an array' do - body = ['I want', 'my hat back'] - response = spy(ActionDispatch::Response, status: 422, body: body, content_type: 'application/json', cookies: {}) - allow(controller).to receive(:response).and_return(response) - get :index - - expect(controller.last_payload[:response]).to eq(body) - end - - it 'does not log a string with an empty body' do - response = spy(ActionDispatch::Response, status: 422, body: nil, content_type: 'application/json', cookies: {}) - allow(controller).to receive(:response).and_return(response) - get :index - - expect(controller.last_payload.has_key?(:response)).to be_falsey - end - - it 'does not log an HTML body' do - response = spy(ActionDispatch::Response, status: 422, body: 'This is a test', content_type: 'application/html', cookies: {}) - allow(controller).to receive(:response).and_return(response) - get :index - - expect(controller.last_payload.has_key?(:response)).to be_falsey - end - end end describe '#access_denied' do |