diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-26 15:09:27 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-01-26 15:09:27 +0300 |
commit | 0121231095b3a50a18aaf4eb4a7058b55fe62fc1 (patch) | |
tree | a29154a1a62ff69fc8816b2694d25a3213cdcd30 /spec/requests/api/oauth_tokens_spec.rb | |
parent | 6fb22ef2ea39f92edf9b237f6e3eca6121c8298b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests/api/oauth_tokens_spec.rb')
-rw-r--r-- | spec/requests/api/oauth_tokens_spec.rb | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/spec/requests/api/oauth_tokens_spec.rb b/spec/requests/api/oauth_tokens_spec.rb index 23d5df873d4..52c7408545f 100644 --- a/spec/requests/api/oauth_tokens_spec.rb +++ b/spec/requests/api/oauth_tokens_spec.rb @@ -26,17 +26,14 @@ RSpec.describe 'OAuth tokens' do end context 'when user does not have 2FA enabled' do - # NOTE: using ROPS grant flow without client credentials will be deprecated - # and removed in the next version of Doorkeeper. - # See https://gitlab.com/gitlab-org/gitlab/-/issues/219137 context 'when no client credentials provided' do - it 'creates an access token' do + it 'does not create an access token' do user = create(:user) request_oauth_token(user) - expect(response).to have_gitlab_http_status(:ok) - expect(json_response['access_token']).not_to be_nil + expect(response).to have_gitlab_http_status(:unauthorized) + expect(json_response['access_token']).to be_nil end end @@ -54,15 +51,11 @@ RSpec.describe 'OAuth tokens' do context 'with invalid credentials' do it 'does not create an access token' do - # NOTE: remove this after update to Doorkeeper 5.5 or newer, see - # https://gitlab.com/gitlab-org/gitlab/-/issues/219137 - pending 'Enable this example after upgrading Doorkeeper to 5.5 or newer' - user = create(:user) request_oauth_token(user, basic_auth_header(client.uid, 'invalid secret')) - expect(response).to have_gitlab_http_status(:bad_request) + expect(response).to have_gitlab_http_status(:unauthorized) expect(json_response['error']).to eq('invalid_client') end end |