diff options
Diffstat (limited to 'spec/requests/openid_connect_spec.rb')
-rw-r--r-- | spec/requests/openid_connect_spec.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/spec/requests/openid_connect_spec.rb b/spec/requests/openid_connect_spec.rb index 82f972e7f94..217241200ff 100644 --- a/spec/requests/openid_connect_spec.rb +++ b/spec/requests/openid_connect_spec.rb @@ -270,13 +270,20 @@ RSpec.describe 'OpenID Connect requests', feature_category: :system_access do end context 'OpenID configuration information' do + let(:expected_scopes) do + %w[ + admin_mode api read_user read_api read_repository write_repository sudo openid profile email + read_observability write_observability create_runner + ] + end + it 'correctly returns the configuration' do get '/.well-known/openid-configuration' expect(response).to have_gitlab_http_status(:ok) expect(json_response['issuer']).to eq('http://localhost') expect(json_response['jwks_uri']).to eq('http://www.example.com/oauth/discovery/keys') - expect(json_response['scopes_supported']).to match_array %w[admin_mode api read_user read_api read_repository write_repository sudo openid profile email read_observability write_observability] + expect(json_response['scopes_supported']).to match_array expected_scopes end context 'with a cross-origin request' do @@ -286,7 +293,7 @@ RSpec.describe 'OpenID Connect requests', feature_category: :system_access do expect(response).to have_gitlab_http_status(:ok) expect(json_response['issuer']).to eq('http://localhost') expect(json_response['jwks_uri']).to eq('http://www.example.com/oauth/discovery/keys') - expect(json_response['scopes_supported']).to match_array %w[admin_mode api read_user read_api read_repository write_repository sudo openid profile email read_observability write_observability] + expect(json_response['scopes_supported']).to match_array expected_scopes end it_behaves_like 'cross-origin GET request' |