diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-24 00:11:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-24 00:11:46 +0300 |
commit | 66e3f84f5200d00e3ce3137dad80592096ef3401 (patch) | |
tree | d564786eec6b40a17c8450051887f949517d2454 /spec/models/commit_spec.rb | |
parent | 5421d61b1d5ffe11a9c7afbe2259b4e4d0e7c993 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/commit_spec.rb')
-rw-r--r-- | spec/models/commit_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb index bab6247d4f9..4b5aabe745b 100644 --- a/spec/models/commit_spec.rb +++ b/spec/models/commit_spec.rb @@ -828,12 +828,14 @@ eos describe 'signed commits' do let(:gpg_signed_commit) { project.commit_by(oid: '0b4bc9a49b562e85de7cc9e834518ea6828729b9') } let(:x509_signed_commit) { project.commit_by(oid: '189a6c924013fc3fe40d6f1ec1dc20214183bc97') } + let(:ssh_signed_commit) { project.commit_by(oid: '7b5160f9bb23a3d58a0accdbe89da13b96b1ece9') } let(:unsigned_commit) { project.commit_by(oid: '54fcc214b94e78d7a41a9a8fe6d87a5e59500e51') } let!(:commit) { create(:commit, project: project) } it 'returns signature_type properly' do expect(gpg_signed_commit.signature_type).to eq(:PGP) expect(x509_signed_commit.signature_type).to eq(:X509) + expect(ssh_signed_commit.signature_type).to eq(:SSH) expect(unsigned_commit.signature_type).to eq(:NONE) expect(commit.signature_type).to eq(:NONE) end @@ -841,9 +843,24 @@ eos it 'returns has_signature? properly' do expect(gpg_signed_commit.has_signature?).to be_truthy expect(x509_signed_commit.has_signature?).to be_truthy + expect(ssh_signed_commit.has_signature?).to be_truthy expect(unsigned_commit.has_signature?).to be_falsey expect(commit.has_signature?).to be_falsey end + + context 'when feature flag "ssh_commit_signatures" is disabled' do + before do + stub_feature_flags(ssh_commit_signatures: false) + end + + it 'reports no signature' do + expect(ssh_signed_commit).not_to have_signature + end + + it 'does not return signature data' do + expect(ssh_signed_commit.signature).to be_nil + end + end end describe '#has_been_reverted?' do |