Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Reigel <mail@koffeinfrei.org>2017-02-22 20:36:25 +0300
committerAlexis Reigel <mail@koffeinfrei.org>2017-07-27 16:40:41 +0300
commit87c0fd34557463528a552986a42f4ebb52d3bd56 (patch)
tree18b35c83421e8a96d4ec49bc248750d9d536b58c /spec/lib/gitlab/gpg_spec.rb
parente34cef0cd2fcf9a01d3f3b6dd215bbcc25d65d27 (diff)
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.rb20
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