diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-01 03:10:22 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-01 03:10:22 +0000 |
commit | 4be784ea00ee98983c29568bfc7914e625a98b6e (patch) | |
tree | e107d082f395615e88a287105bb6390482af15f4 /spec/controllers/oauth | |
parent | 57ac0bc8f74b1e21cdc58607e217b79d307e1e40 (diff) | |
download | gitlab-ce-4be784ea00ee98983c29568bfc7914e625a98b6e.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers/oauth')
-rw-r--r-- | spec/controllers/oauth/token_info_controller_spec.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/spec/controllers/oauth/token_info_controller_spec.rb b/spec/controllers/oauth/token_info_controller_spec.rb index 91a986db251..6d01a534673 100644 --- a/spec/controllers/oauth/token_info_controller_spec.rb +++ b/spec/controllers/oauth/token_info_controller_spec.rb @@ -5,10 +5,10 @@ require 'spec_helper' RSpec.describe Oauth::TokenInfoController do describe '#show' do context 'when the user is not authenticated' do - it 'responds with a 401' do + it 'responds with a 400' do get :show - expect(response).to have_gitlab_http_status(:unauthorized) + expect(response).to have_gitlab_http_status(:bad_request) expect(Gitlab::Json.parse(response.body)).to include('error' => 'invalid_request') end end @@ -36,10 +36,10 @@ RSpec.describe Oauth::TokenInfoController do end context 'when the doorkeeper_token is not recognised' do - it 'responds with a 401' do + it 'responds with a 400' do get :show, params: { access_token: 'unknown_token' } - expect(response).to have_gitlab_http_status(:unauthorized) + expect(response).to have_gitlab_http_status(:bad_request) expect(Gitlab::Json.parse(response.body)).to include('error' => 'invalid_request') end end @@ -49,10 +49,10 @@ RSpec.describe Oauth::TokenInfoController do create(:oauth_access_token, created_at: 2.days.ago, expires_in: 10.minutes) end - it 'responds with a 401' do + it 'responds with a 400' do get :show, params: { access_token: access_token.token } - expect(response).to have_gitlab_http_status(:unauthorized) + expect(response).to have_gitlab_http_status(:bad_request) expect(Gitlab::Json.parse(response.body)).to include('error' => 'invalid_request') end end @@ -60,10 +60,10 @@ RSpec.describe Oauth::TokenInfoController do context 'when the token is revoked' do let(:access_token) { create(:oauth_access_token, revoked_at: 2.days.ago) } - it 'responds with a 401' do + it 'responds with a 400' do get :show, params: { access_token: access_token.token } - expect(response).to have_gitlab_http_status(:unauthorized) + expect(response).to have_gitlab_http_status(:bad_request) expect(Gitlab::Json.parse(response.body)).to include('error' => 'invalid_request') end end |