diff options
author | Alexis Reigel <mail@koffeinfrei.org> | 2017-02-22 18:36:25 +0100 |
---|---|---|
committer | Alexis Reigel <mail@koffeinfrei.org> | 2017-07-27 15:40:41 +0200 |
commit | 87c0fd34557463528a552986a42f4ebb52d3bd56 (patch) | |
tree | 18b35c83421e8a96d4ec49bc248750d9d536b58c /spec/lib/gitlab/gpg_spec.rb | |
parent | e34cef0cd2fcf9a01d3f3b6dd215bbcc25d65d27 (diff) | |
download | gitlab-ce-87c0fd34557463528a552986a42f4ebb52d3bd56.tar.gz |
add / remove gpg keys to / from system keychain
Diffstat (limited to 'spec/lib/gitlab/gpg_spec.rb')
-rw-r--r-- | spec/lib/gitlab/gpg_spec.rb | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/spec/lib/gitlab/gpg_spec.rb b/spec/lib/gitlab/gpg_spec.rb index a59302e6738..2f779492c24 100644 --- a/spec/lib/gitlab/gpg_spec.rb +++ b/spec/lib/gitlab/gpg_spec.rb @@ -15,6 +15,24 @@ describe Gitlab::Gpg do end end - describe '.add_to_keychain' do + describe '.add_to_keychain', :gpg do + it 'stores the key in the keychain' do + expect(GPGME::Key.find(:public, '4F4840A503964251CF7D7F5DC728AF10972E97C0')).to eq [] + + Gitlab::Gpg.add_to_keychain(GpgHelpers.public_key) + + expect(GPGME::Key.find(:public, '4F4840A503964251CF7D7F5DC728AF10972E97C0')).not_to eq [] + end + end + + describe '.remove_from_keychain', :gpg do + it 'removes the key from the keychain' do + Gitlab::Gpg.add_to_keychain(GpgHelpers.public_key) + expect(GPGME::Key.find(:public, '4F4840A503964251CF7D7F5DC728AF10972E97C0')).not_to eq [] + + Gitlab::Gpg.remove_from_keychain('4F4840A503964251CF7D7F5DC728AF10972E97C0') + + expect(GPGME::Key.find(:public, '4F4840A503964251CF7D7F5DC728AF10972E97C0')).to eq [] + end end end |