diff options
author | Rubén Dávila <ruben@gitlab.com> | 2017-10-06 06:43:44 +0300 |
---|---|---|
committer | Rubén Dávila <ruben@gitlab.com> | 2017-10-06 06:43:44 +0300 |
commit | 555f50b3e68e82968ea2eb4916a3f5beeeef7b31 (patch) | |
tree | d4ca097c04ceb3c5ae5954bcce29ddd13c1d56d6 /spec/lib/gitlab/gpg_spec.rb | |
parent | 5595d73763caf224df4109ab2d52e616cd843d49 (diff) |
Add more specs.
Diffstat (limited to 'spec/lib/gitlab/gpg_spec.rb')
-rw-r--r-- | spec/lib/gitlab/gpg_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/lib/gitlab/gpg_spec.rb b/spec/lib/gitlab/gpg_spec.rb index 11a2aea1915..ab9a166db00 100644 --- a/spec/lib/gitlab/gpg_spec.rb +++ b/spec/lib/gitlab/gpg_spec.rb @@ -28,6 +28,23 @@ describe Gitlab::Gpg do end end + describe '.subkeys_from_key' do + it 'returns the subkeys by primary key' do + all_subkeys = described_class.subkeys_from_key(GpgHelpers::User1.public_key) + subkeys = all_subkeys[GpgHelpers::User1.primary_keyid] + + expect(subkeys).to be_present + expect(subkeys.first[:keyid]).to be_present + expect(subkeys.first[:fingerprint]).to be_present + end + + it 'returns an empty array when there are not subkeys' do + all_subkeys = described_class.subkeys_from_key(GpgHelpers::User4.public_key) + + expect(all_subkeys[GpgHelpers::User4.primary_keyid]).to be_empty + end + end + describe '.user_infos_from_key' do it 'returns the names and emails' do user_infos = described_class.user_infos_from_key(GpgHelpers::User1.public_key) |