summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-08-15 12:01:34 +0000
committerStan Hu <stanhu@gmail.com>2019-08-15 12:01:34 +0000
commit36a729f05f1b9c2b3935b9d121b8fe3172ce5cc1 (patch)
treeae07698ca456be7a83c3267bf54909594ff2283f /spec
parent2c71a94744eba516d10725302ce7ffeb5d4625ab (diff)
parent2857a40950d23173e4280513a5f318b89d1d0a11 (diff)
downloadgitlab-ce-36a729f05f1b9c2b3935b9d121b8fe3172ce5cc1.tar.gz
Merge branch 'georgekoltsov/48854-fix-empty-flash-message' into 'master'ce-update-ff-permissions-for-new-strategies
Exclude json content type from workhorse interception See merge request gitlab-org/gitlab-ce!31809
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/application_controller_spec.rb28
1 files changed, 18 insertions, 10 deletions
diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb
index 84bbbac39b0..0b3833e6515 100644
--- a/spec/controllers/application_controller_spec.rb
+++ b/spec/controllers/application_controller_spec.rb
@@ -641,24 +641,32 @@ describe ApplicationController do
end
end
- it 'does not set a custom header' do
+ it 'sets a custom header' do
get :index, format: :json
- expect(response.headers['X-GitLab-Custom-Error']).to be_nil
+ expect(response.headers['X-GitLab-Custom-Error']).to eq '1'
end
- end
- context 'given a json response for an html request' do
- controller do
- def index
- render json: {}, status: :unprocessable_entity
+ context 'for html request' do
+ it 'sets a custom header' do
+ get :index
+
+ expect(response.headers['X-GitLab-Custom-Error']).to eq '1'
end
end
- it 'does not set a custom header' do
- get :index
+ context 'for 200 response' do
+ controller do
+ def index
+ render json: {}, status: :ok
+ end
+ end
- expect(response.headers['X-GitLab-Custom-Error']).to be_nil
+ it 'does not set a custom header' do
+ get :index, format: :json
+
+ expect(response.headers['X-GitLab-Custom-Error']).to be_nil
+ end
end
end
end