diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-13 03:09:34 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-13 03:09:34 +0300 |
commit | 3cd08f4bf96cda3e9d3abf233095107832b17c20 (patch) | |
tree | dc09a618783a79d70f2a404374d4b850ccf9cc84 /spec/lib/gitlab/x509 | |
parent | dd4bee69b7d55620f7dc9db8c36b478bd4959755 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/x509')
-rw-r--r-- | spec/lib/gitlab/x509/commit_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/lib/gitlab/x509/commit_spec.rb b/spec/lib/gitlab/x509/commit_spec.rb index c31e9e4b8e6..07d7eba6b9a 100644 --- a/spec/lib/gitlab/x509/commit_spec.rb +++ b/spec/lib/gitlab/x509/commit_spec.rb @@ -111,6 +111,22 @@ describe Gitlab::X509::Commit do expect(signature.x509_certificate.x509_issuer).to have_attributes(user1_issuer_attributes) expect(signature.persisted?).to be_truthy end + + context 'revoked certificate' do + let(:x509_issuer) { create(:x509_issuer, user1_issuer_attributes) } + let!(:x509_certificate) { create(:x509_certificate, user1_certificate_attributes.merge(x509_issuer_id: x509_issuer.id, certificate_status: :revoked)) } + + it 'returns an unverified signature' do + expect(signature).to have_attributes( + commit_sha: commit_sha, + project: project, + verification_status: 'unverified' + ) + expect(signature.x509_certificate).to have_attributes(user1_certificate_attributes) + expect(signature.x509_certificate.x509_issuer).to have_attributes(user1_issuer_attributes) + expect(signature.persisted?).to be_truthy + end + end end context 'without trusted certificate within store' do |