Commit 387b5df9 authored by Vitali Tatarintev's avatar Vitali Tatarintev

Merge branch 'epic-5076-spec/controllers/jwks_controller_spec.rb' into 'master'

Migrate jwks_controller specs to request specs of them

See merge request gitlab-org/gitlab!50767
parents 8dcf4b99 5ce2ed0c
---
title: Migrate jwks_controller specs to request specs of them
merge_request: 50767
author: Takuya Noguchi @tnir
type: other
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
require 'spec_helper' require 'spec_helper'
RSpec.describe JwksController do RSpec.describe JwksController do
describe 'GET #index' do describe 'GET /-/jwks' do
let(:ci_jwt_signing_key) { OpenSSL::PKey::RSA.generate(1024) } let(:ci_jwt_signing_key) { OpenSSL::PKey::RSA.generate(1024) }
let(:ci_jwk) { ci_jwt_signing_key.to_jwk } let(:ci_jwk) { ci_jwt_signing_key.to_jwk }
let(:oidc_jwk) { OpenSSL::PKey::RSA.new(Rails.application.secrets.openid_connect_signing_key).to_jwk } let(:oidc_jwk) { OpenSSL::PKey::RSA.new(Rails.application.secrets.openid_connect_signing_key).to_jwk }
...@@ -13,7 +13,7 @@ RSpec.describe JwksController do ...@@ -13,7 +13,7 @@ RSpec.describe JwksController do
end end
it 'returns signing keys used to sign CI_JOB_JWT' do it 'returns signing keys used to sign CI_JOB_JWT' do
get :index get jwks_url
expect(response).to have_gitlab_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
...@@ -22,7 +22,7 @@ RSpec.describe JwksController do ...@@ -22,7 +22,7 @@ RSpec.describe JwksController do
end end
it 'does not leak private key data' do it 'does not leak private key data' do
get :index get jwks_url
aggregate_failures do aggregate_failures do
json_response['keys'].each do |jwk| json_response['keys'].each do |jwk|
......
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