diff options
author | Alexis Reigel <mail@koffeinfrei.org> | 2017-06-13 14:46:43 +0300 |
---|---|---|
committer | Alexis Reigel <mail@koffeinfrei.org> | 2017-07-27 16:42:53 +0300 |
commit | 3c42d730986222d891c9b7985edf3942021afcef (patch) | |
tree | 4631a62e7cbfba445e8cf6b89f9b5e6582aa4cc3 /spec/lib/gitlab/gpg_spec.rb | |
parent | 7e13d96715750f74db399bf40ee4ec9679bbe806 (diff) |
add primary keyid attribute to gpg keys
Diffstat (limited to 'spec/lib/gitlab/gpg_spec.rb')
-rw-r--r-- | spec/lib/gitlab/gpg_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/lib/gitlab/gpg_spec.rb b/spec/lib/gitlab/gpg_spec.rb index bdcf9ee0e65..55f34e0cf99 100644 --- a/spec/lib/gitlab/gpg_spec.rb +++ b/spec/lib/gitlab/gpg_spec.rb @@ -15,6 +15,20 @@ describe Gitlab::Gpg do end end + describe '.primary_keyids_from_key' do + it 'returns the keyid' do + expect( + described_class.primary_keyids_from_key(GpgHelpers::User1.public_key) + ).to eq [GpgHelpers::User1.primary_keyid] + end + + it 'returns an empty array when the key is invalid' do + expect( + described_class.primary_keyids_from_key('bogus') + ).to eq [] + end + end + describe '.emails_from_key' do it 'returns the emails' do expect( |