Commit eb77e106 authored by Alexis Reigel's avatar Alexis Reigel

add second gpg key for specs

parent 87c0fd34
......@@ -2,6 +2,6 @@ require_relative '../support/gpg_helpers'
FactoryGirl.define do
factory :gpg_key do
key GpgHelpers.public_key
key GpgHelpers::User1.public_key
end
end
......@@ -4,7 +4,7 @@ describe Gitlab::Gpg do
describe '.fingerprints_from_key' do
it 'returns the fingerprint' do
expect(
described_class.fingerprints_from_key(GpgHelpers.public_key)
described_class.fingerprints_from_key(GpgHelpers::User1.public_key)
).to eq ['4F4840A503964251CF7D7F5DC728AF10972E97C0']
end
......@@ -19,7 +19,7 @@ describe Gitlab::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)
Gitlab::Gpg.add_to_keychain(GpgHelpers::User1.public_key)
expect(GPGME::Key.find(:public, '4F4840A503964251CF7D7F5DC728AF10972E97C0')).not_to eq []
end
......@@ -27,7 +27,7 @@ describe Gitlab::Gpg do
describe '.remove_from_keychain', :gpg do
it 'removes the key from the keychain' do
Gitlab::Gpg.add_to_keychain(GpgHelpers.public_key)
Gitlab::Gpg.add_to_keychain(GpgHelpers::User1.public_key)
expect(GPGME::Key.find(:public, '4F4840A503964251CF7D7F5DC728AF10972E97C0')).not_to eq []
Gitlab::Gpg.remove_from_keychain('4F4840A503964251CF7D7F5DC728AF10972E97C0')
......
......@@ -422,11 +422,11 @@ eos
context 'signed commit', :gpg do
it 'returns a valid signature if the public key is known' do
GPGME::Key.import(GpgHelpers.public_key)
GPGME::Key.import(GpgHelpers::User1.public_key)
raw_commit = double(:raw_commit, signature: [
GpgHelpers.signed_commit_signature,
GpgHelpers.signed_commit_base_data
GpgHelpers::User1.signed_commit_signature,
GpgHelpers::User1.signed_commit_base_data
])
allow(raw_commit).to receive :save!
......@@ -440,8 +440,8 @@ eos
it 'returns an invalid signature if the public commit is unknown', :gpg do
raw_commit = double(:raw_commit, signature: [
GpgHelpers.signed_commit_signature,
GpgHelpers.signed_commit_base_data
GpgHelpers::User1.signed_commit_signature,
GpgHelpers::User1.signed_commit_base_data
])
allow(raw_commit).to receive :save!
......
......@@ -16,7 +16,7 @@ describe GpgKey do
context 'callbacks', :gpg do
describe 'extract_fingerprint' do
it 'extracts the fingerprint from the gpg key' do
gpg_key = described_class.new(key: GpgHelpers.public_key)
gpg_key = described_class.new(key: GpgHelpers::User1.public_key)
gpg_key.valid?
expect(gpg_key.fingerprint).to eq '4F4840A503964251CF7D7F5DC728AF10972E97C0'
end
......@@ -24,7 +24,7 @@ describe GpgKey do
describe 'add_to_keychain' do
it 'calls add_to_keychain after create' do
expect(Gitlab::Gpg).to receive(:add_to_keychain).with(GpgHelpers.public_key)
expect(Gitlab::Gpg).to receive(:add_to_keychain).with(GpgHelpers::User1.public_key)
create :gpg_key
end
end
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment