Commit 8e0697da authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'rails5-fix-47804' into 'master'

Rails5 fix stack level too deep

Closes #47804

See merge request gitlab-org/gitlab-ce!19762
parents 69966fcb b6996837
---
title: Rails5 fix stack level too deep
merge_request: 19762
author: Jasper Maes
type: fixed
...@@ -512,7 +512,7 @@ describe ApplicationController do ...@@ -512,7 +512,7 @@ describe ApplicationController do
context '422 errors' do context '422 errors' do
it 'logs a response with a string' do it 'logs a response with a string' do
response = spy(ActionDispatch::Response, status: 422, body: 'Hello world', content_type: 'application/json') response = spy(ActionDispatch::Response, status: 422, body: 'Hello world', content_type: 'application/json', cookies: {})
allow(controller).to receive(:response).and_return(response) allow(controller).to receive(:response).and_return(response)
get :index get :index
...@@ -521,7 +521,7 @@ describe ApplicationController do ...@@ -521,7 +521,7 @@ describe ApplicationController do
it 'logs a response with an array' do it 'logs a response with an array' do
body = ['I want', 'my hat back'] body = ['I want', 'my hat back']
response = spy(ActionDispatch::Response, status: 422, body: body, content_type: 'application/json') response = spy(ActionDispatch::Response, status: 422, body: body, content_type: 'application/json', cookies: {})
allow(controller).to receive(:response).and_return(response) allow(controller).to receive(:response).and_return(response)
get :index get :index
...@@ -529,7 +529,7 @@ describe ApplicationController do ...@@ -529,7 +529,7 @@ describe ApplicationController do
end end
it 'does not log a string with an empty body' do it 'does not log a string with an empty body' do
response = spy(ActionDispatch::Response, status: 422, body: nil, content_type: 'application/json') response = spy(ActionDispatch::Response, status: 422, body: nil, content_type: 'application/json', cookies: {})
allow(controller).to receive(:response).and_return(response) allow(controller).to receive(:response).and_return(response)
get :index get :index
...@@ -537,7 +537,7 @@ describe ApplicationController do ...@@ -537,7 +537,7 @@ describe ApplicationController do
end end
it 'does not log an HTML body' do it 'does not log an HTML body' do
response = spy(ActionDispatch::Response, status: 422, body: 'This is a test', content_type: 'application/html') response = spy(ActionDispatch::Response, status: 422, body: 'This is a test', content_type: 'application/html', cookies: {})
allow(controller).to receive(:response).and_return(response) allow(controller).to receive(:response).and_return(response)
get :index get :index
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment